Professional Documents
Culture Documents
QUEUE
A queue is a linear list of elements in which
– deletion can take place only at one end
called Front, and
– Insertion takes place at one end called Rear
Queues are also known as First-In-
First-Out (FIFO) list
Queue are represented in two-ways
– Linear Array
– One-way Linked List
Applications of Queue
A queue is maintained by a
– linear array QUEUE
– Two pointer variable
queue is empty
Array representation of Queue
Array representation of Queue
CIRCULAR QUEUE
RIGHT = RIGHT +1
When element is inserted at LEFT side:
LEFT = LEFT – 1
When element is deleted from RIGHT side:
RIGHT = RIGHT -1
When element is deleted from LEFT side:
LEFT = LEFT + 1
Deque is FULL when:
LEFT =1 and RIGHT = n OR LEFT = RIGHT +1
Deque
Deque
Deque
Deque
Variation of deque