Stacks and Queues
We are familiar with arrays and the operations performed on them. The various 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 floor 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 first one to leave. The second customer would get the second last packet and so on. In the mean time, if more packets arrive then they will be added on the ...