A circular queue is a queue in which all nodes are treated as circular such that the first node follows the last node.

In a linked list circular queue, the rear node always has the reference of the front node. Even if the front node is removed the rear node has the reference of the new front node.

The common operations on circular queue are:

§ **qstore(:** adding elements at the end of a circular queue.

§ **qdelete:** removing elements from the front of the circular queue.

§ **isfull: **isfull finds out whether the circular queue is full

§ **isempty:** isempty finds out whether the circular queue is empty

§ **create:** to create an empty circular queue** **

**Applications of circular queue: **

**Adding large integers: **Large integers can be added very easily using circular queues. Here the rightmost digit is placed in the front node and leftmost digit is placed in the rear node.

**Memory management: **The unused memory locations in the case of ordinary queues can be utilized in circular queues.

**Computer controlled traffic system: **In computer controlled traffic system, circular queues are used to switch on the traffic lights one by one repeatedly as per the time set.

## 0 comments:

## Post a Comment