Topics: Data Structure
A queue is linear data structure in which we operate through its two ends. We insert elements through one end and delete them through the other.
The first element in a queue is the first one that’s going out. This is why queues are also known as FIFO-type structures (first in, first out).
Stacks have the following operations:
- Iteration through the stack
- Element insertion (push)
- Element deletion (pop)
- Element search
Biqueues are a special type of queues from which we can insert/delete elements through *both *the head or the tail.
There are two types of biqueues:
- Restricted entry biqueue: this biqueue allows deletions to be carried out from any of its two ends, but insertions can only be carried out from the tail
- Restricted exit biqueue: this biqueue allows insertions from any of its two ends, but deletions can only be carried out from the tail
A priority queue is a special type of queue in which every element has an integer attached to it to indicate its processing priority.
The way in which a given element is inserted or deleted is:
- The element with the highest priority is the first one processed
- Two elements with the same priority are processed according to the order in which they were inserted to the queue
- The lower the priority integer, the higher the proirity.