Posts

Data Structures and Algorithms : Simple Circular Queue

1.Simple Circular Queue First, we should Remember circular Queue is a linear DS. 2nd in this operation are performed based on FIFO  Principle. 3rd the last position is connected with the first position so it makes a Circle. The circle is also called Ring Buffer.                                   In a normal Queue, we can insert elements until queue becomes full. But once queue becomes full, we can not insert the next element even if there is a space in front of the queue. Enqueue is a function via this we add elements to the queue. Dequeue is a function via this we remove the element from the queue. When Rear is the move we Insert the element in the queue. but when Front is moving we Delete the element from the queue. shown in fig queue is Full – Check ((rear == SIZE-1 && front == 0) || (rear == front-1)).  If queue is not full then, check if (rear == SIZE – 1...
Recent posts