Introduction To Data Structures and Algorithms - Lecture 5
Introduction To Data Structures and Algorithms - Lecture 5
1
Figure 3.11(b) stack implementation
2
3.9 Queue
A Queue is a linear structure which follows a particular order in which the operations are
performed. The order is First in First Out (FIFO). A good example of a queue is any queue of
consumers for a resource where the consumer that came first is served first. The difference
between stacks and queues is in removing. In a stack we remove the item the most recently
added; in a queue, we remove the item the least recently added.
3
Figure 3.13 (b) implementation of queue