A queue in software is a data structure that follows the First In, First Out (FIFO) principle. This means that the first element added to the queue will be the first one to be removed. It is analogous to a line of people waiting for service, where the person who arrives first is served first.
Here are the basic operations associated with queues:
- Enqueue (Insert): Adds an element to the rear of the queue.
- Dequeue (Delete): Removes and returns the element from the front of the queue.
- Peek: Returns the element at the front of the queue without removing it.
- Empty: Checks if the queue is empty.
- Full: Checks if the queue is full.