Class 2
Class 2
Head
Pointer field Information field
[STACK]
Stack
The stack can be implemented into two ways:
◦ Using arrays (Static implementation)
◦ Using pointer (Dynamic implementation)
Queue
Queue are first in first out type of data structure
(i.e., FIFO)
In a queue new elements are added to the queue
from one end called REAR end and the element are
always removed from other end called the FRONT
end.
The people standing in a railway reservation row are
an example of queue.
Queue
Each new person comes and stands at the end of the row
and person getting their reservation confirmed get out of
the row from the front end.
The bellow show figure how the operations take place on a
stack:
10 20 30 40 50
front rear
Queue
The queue can be implemented into two ways:
◦ Using arrays (Static implementation)
◦ Using pointer (Dynamic implementation)