advantages of circular queue in linear queue
Answers
Answered by
5
Linear Queue
It is a data
structure which is almost like a stack. But in this the first item inserted is
the first to be removed. A queue works like a line in which we wait.
Disadvantage
New items
cannot be inserted continuously.
Circular Queue
It is a linear
data structure in which the operations are conducted on the basis of FIFO or
First In First Out principle. The last position is connected to the first
position to make a circle. It is also known as Ring Buffer.
Advantages
1. It takes up
less memory than the linear queue.
2. A new item can
be inserted in the location from where a previous item is deleted.
3. Infinite
number of elements can be added continuously but deletion must be used.
It is a data
structure which is almost like a stack. But in this the first item inserted is
the first to be removed. A queue works like a line in which we wait.
Disadvantage
New items
cannot be inserted continuously.
Circular Queue
It is a linear
data structure in which the operations are conducted on the basis of FIFO or
First In First Out principle. The last position is connected to the first
position to make a circle. It is also known as Ring Buffer.
Advantages
1. It takes up
less memory than the linear queue.
2. A new item can
be inserted in the location from where a previous item is deleted.
3. Infinite
number of elements can be added continuously but deletion must be used.
Similar questions