Ds Notes Ch01
Ds Notes Ch01
Data structures are the building blocks of a program; here the selection of a
particular data structure will help the programmer to design more efficient
programs as the complexity and volume of the problems solved by the
computer is steadily increasing day by day.
Character: Some data are storing character or string form. There are
different codes available to store data in character form such as BCD,
EDCDIC and ASCII.
Boolean: Some data are represent in only two way like true-false, on-off
or flag set-flag reset. These kinds of data are considering Boolean type.
Based on the structure and arrangement of data, non-primitive data structures are
further classified into linear and non-linear.
Arrays: Linear array mean a list of a finite number n of similar data elements
referenced respectively by a set of n consecutive numbers, usually 0,1,2,…..,n.
Linked List: Consider following fig 1.7 is example of linked lists. Although the
terms “pointer” and “link” are usually used synonymously. The term “pointer”
when an element in one list points to an element in a different list and to reverse
the term “link” for the case when an element in a list points to an element in that
same list.
Stacks: A stack also called last-in first-out (LIFO) system, is a linear list in
which insertions and deletions can be take place only at one end, called the top.
This structure is similar in its operation to a stack of dishes on a spring system.
Note that new dishes are inserted only at the stack and dishes can be deleted only
from the top of the stack.
Queue: A queue also called a first-in first-out (FIFO) system, is a linear list in
which deletion can be take place only at one end of the list, the “front” of the list
and insertions can take place only at the other end of the list, the “rear” of the list.
This structure operates in much the same way as a line of people waiting at the
bus stop. Another analogy is which automobiles waiting to pass through an
insertion-the first car in the first car through.
3. In the final stage we choose an implementation for each abstract data type and
write the procedures for the various operations on that type. The remaining
informal statements in the pseudo-language algorithm are replaced by (or any
programming language) C/C++ code.
Complexity:
Abstract Data Type: