
266 Data Structures Using C
It may be noted that with the help of dummy nodes, the basic nature of linked lists remains
intact.
6.6 LINKED STACKS
We know that a stack is a LIFO (last in first out) data structure. Earlier
in the book, the stack was implemented using an array. Though the
array implementation was efficient but a considerable amount of storage
space was wasted in the form of unutilized locations of the array. For
example, let us assume that at a given time, there are five elements in a
stack. If the stack is implemented using 20 locations, then 15 locations
out of 20 are being wasted.
A solution to this problem is dynamic storag ...