Preface
Most books on C and Data Structures cover theoretical concepts without program implementation. It
is the intention of this book to provide the learning material on C and Data Structures with basics
together with programs to beginners in an understandable and easy manner.
This book is meant for the students of Computer Science and Engineering and Electronics
Engineering of Anna University, Chennai. The contents are designed exclusively as per the Computer
Science and Engineering syllabus. In addition, the contents will be useful to Electronics Engineering
students. Except Pascal, learning material on C and Data Structures has been provided for Electronics
students.
This book is also helpful in other streams such as BCA, MCA, as well as for students of diploma and
engineering and science branches.
Attempt has been made to present every concept in an easy way with simple programs. The programs
are thoroughly checked and their results are displayed. Adequate number of questions has been given
at the end of each chapter. All programs are fully tested with Turbo C++ Version 3.00.
Organisation of the Book
Chapter 1 is focused on the basics of algorithm, flowchart, pseudocodes, sequence, selection, iteration,
and basics of C program. In addition, the reader is exposed to the classification of algorithms and
introduction to programming techniques. The role of interpreter, compiler and the distinction between
them is also described in this chapter. Mention is also made of the various sections of a C program and
the rules that should be adopted while writing a program. The distinction between iteration and
recursion is made as well.
Chapter 2 exposes the reader to the fundamentals of C. Different types of characters such as Letters,
Digits, White space, and Special Characters are described. Various delimiters used with C statements,
keywords, and identifiers are also explained. Different constants, variables, and data types to be used
in C are narrated. The rules for defining and initializing variables are explained.
Chapter 3 explains the various operators with their priorities. The use of comma and conditional
operators are explained. Various operators, like arithmetic, relational, logical and bitwise operators,
are also covered in this chapter.
Chapter 4 deals with the various I/O functions of C language. Formatted and unformatted functions
with supporting conversion characters and escape sequences are explained. The character I/O, string
I/O and frequently useful functions are also elaborated.
Chapter 5 explains the conditional structures of C, that is, i f - else and switch case statements with
their nested use. The supporting statements, break, cont inue, and goto, are also illustrated.
Chapter 6 is devoted to loop statements, that is, for loop, while loop and do-while loop. The limitations
of do-while loop and the while loop are covered.
vi Preface
C apter 7 explains declaration and initialization of arrays. It covers one-, two-, three-, and multi-
d tensional arrays. The characteristics of arrays are explained at the beginning of this chapter. The
functions scanf () and sprint f () are also discussed with suitable examples. These two functions are
used for reading data from array and writing data to array.
Chapter 8 covers detail and initialization of strings. The various formats for display of strings are
described. The standard string functions are illustrated with numerous examples. The application of
strings is given at the end of the chapter.
Chapter 9 explains pointers. The features of the pointer are described, followed by the procedure for its
declaration. This chapter consists of arithmetic operators with pointers, pointers and arrays, array of
pointers, pointers to pointers, and pointer to strings.
Chapter 10 is focused on functions—how to initialize functions, where to use functions, how functions
interact with one another. The answers to such questions are provided with examples. How to use
function as an argument is also described. The reader can follow the concepts of functions by executing
programs as illustrated in this chapter. The recursive nature of functions is also explained with
suitable examples.
Chapter 11 throws lijfhf on various pre-defined macros in ANSI and Turbo C as well as user-defined
macros. It consists of # defin e, #undef, # in clu de, # lin e, token pasting and stringizing operator and
conditional compilation. The #error and #pragma directives are also described together with examples.
At the end, various macros defined in header file s t d i o . h and ctyp e. h are explained.
Chapter 12 is an important chapter since it contains various features of structures and unions. Features
of structure with their declaration and initialization are described. The use of dot (.) and arrow (->)
operators is explained with examples. The operation of structure with function, pointer, array and the
nested structure with diagram and practical application are elaborated. The typedef statement,
enumerated data type and bit fields are discussed. The derived data type union and its use to invoke
various ROM-BIOS and DOS services are explained with suitable examples.
Chapter 13 contains the theory of files. The various steps of file operations including high-level and
low-level files are discussed. The use of structure with file is explained. The various functions used
during file operations are listed and described. The command line argument and environment variables
with simulation of various MS-DOS commands are elaborated. The I/O redirections for storing data
from programs and sending data to programs are explained.
Chapter 14 introduces data structures. It covers description of static and dynamic linked lists. The
insertion, deletion, merging, and searching operations on elements with the help of these linked list
techniques have been explained.The data structure stack and queue with their representation and
implementations are illustrated. Types of linked list such as single and double linked list are explained
with numerous examples.
Chapter 15 explains non-linear data structure and its types such as trees and binary trees. The traversing
of binary tree and binary search tree with representation and implementation is elaborated. In the end
various hashing techniques are explained. Programs are provided for understanding non-linear data
structures.
Chapter 16 is devoted to searching and sorting. Popular search techniques such as linear and binary
search are explained with examples. Sorting techniques such as Bubble, Insertion, Tree, and Merge
sorts are explained with programs.
Utmost care has been taken to make this book free of errors. However, should you come across an error,
please do not hesitate to contact me. Your suggestions and feedback may be sent at
kamthanean@yahoo.com.
Ashok N. Kamthane
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.145.82