4.1 STACKS
We are familiar with arrays and the operations performed on them. e vari-
ous elements can be accessed from any position in a list, stored in an array.
Some practical applications require that the additions or deletions be done
only at one end. For example, the packets of wheat oor received in a super
bazaar are put on top of another in the order of their arrival. Now, a customer
can remove only the packet currently lying on the top, i.e., the last packet
arrived in the bazaar is the rst one to leave. e second customer would get
the second last packet and so on. In the mean time, if more packets arrive
then they will be added ...