Queue Operations
Basic queue operations are as follows:
- enqueue()
- dequeue()
- peek()
- isFull()
- isEmpty()
Enqueue()
It adds an item to the queue.
It does so by following the below steps:
- It first checks if the queue is full.
- If it is full, it produces overflow and exits.
- If it is not, then it increments the rear pointer to point at the next empty space.
- Then an element is added to the empty space.
- It returns success.
The algorithm:

Dequeue
It removes an item from the queue.
It follows the following steps:
- Firstly, it checks if the queue is empty.
- If it is empty it produces an overflow error and exits.
- If it is not then it accesses the data where the front pointer points.
- Then it increments the front pointer.
- Finally, it returns success.
The algorithm:
Peek()
It gets the element to the front of the queue.
The algorithm:
isFull()
It checks if the queue is full.
The algorithm:
isEmpty()
It checks if the queue is empty.
The algorithm:
Reference