- Docs
- STL
- Implement
# Queue Overview
A queue is a First In, First Out(FIFO) linear data structure.
It's commonly used in scenarios where the order of processing is important,
such as task scheduling and handling requests in computer networks.
# Operations:
1. Enqueue
- Description: Adds an element to the rear of the queue.
- Syntax: void enqueue(const T& value);
2. Dequeue
- Description: Removes the front element from the queue.
- Syntax: void dequeue();
3. Front
- Description: Returns a reference to the front element of the queue.
- Syntax: T & front();
4. Size
- Description: Returns the number of elements in the queue.
- Syntax: size_t size() const ;
5. Empty
- Description: Checks if the queue is empty.
- Syntax: bool empty() const ;
Overflow: Adding to a full queue may lead to data loss or instability.
Underflow: Removing from an empty queue may cause errors or unexpected behavior.