DSA Module 02 Part 01
DSA Module 02 Part 01
Module -02
Part-01
Queue as ADT(abstract data type.)
• These operations are as follows.
• Queue create(Q_size)→create an empty queue whose max size is Q_size
• We can solve this problem by joining the front and rear end of a queue to
make the queue as a circular queue .
• In circular queue the last node is connected back to the first node to make
a circle.
Overcome disadvantage of linear queue:
• It is also called as “Ring buffer”.
1. Circular Queue
3. Priority Queue
Circular Queue
Circular Queue
Enqueue(Insert) operation on Circular Queue:
• insertQ():
Before inserting ,check for sufficient space in the queue .But once the
queue is full , we can increase the size of queue using relloc()
Delete () and display() are as
same as linear queue