0% found this document useful (0 votes)
5 views19 pages

Types of Queues: Linear, Circular, Priority

Uploaded by

Abhilov Gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views19 pages

Types of Queues: Linear, Circular, Priority

Uploaded by

Abhilov Gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

• The major drawback of using a linear Queue is that insertion is done only from

the rear end. If the first three elements are deleted from the Queue, we cannot
insert more elements even though the space is available in a Linear Queue.
• The drawback that occurs in a linear queue is overcome by using the circular queue. If
the empty space is available in a circular queue, the new element can be added in an
empty space by simply incrementing the value of rear. The main advantage of using
the circular queue is better memory utilization.
Insertion in priority queue takes place based on the arrival, while deletion in the priority queue occurs based on the
priority. Priority queue is mainly used to implement the CPU scheduling algorithms.
There are two types of priority queue that are discussed as follows –

•Ascending priority queue - In ascending priority queue, elements can be inserted in arbitrary order, but only smallest can
be deleted first. Suppose an array with elements 7, 5, and 3 in the same order, so, insertion can be done with the same
sequence, but the order of deleting the elements is 3, 5, 7.

•Descending priority queue - In descending priority queue, elements can be inserted in arbitrary order, but only the
largest element can be deleted first. Suppose an array with elements 7, 3, and 5 in the same order, so, insertion can be
done with the same sequence, but the order of deleting the elements is 7, 5, 3.

You might also like