Drawback of Queue

0
43
drawback of queue

Queue has drawback that, after certain operations, we cannot insert item in the even if there is space in the Queue.
Moves to words the end of the array ,so it that rear will reach at the minimum limit of the array and there may be space before front but no additional can be done at the front end because it will destroy (FIFO) first in first out nature of queue.
This situation there is no space after rear hence no additional can be done even there is no empty space in the queue.
Solution
There are two solutions to the above problem.
Maintaining linearity of the queue .
Queue Declaration
# define max 8
Start queue
{
Int front rear;
Int ele [max];
};

LEAVE A REPLY

Please enter your comment!
Please enter your name here