Correct option is C
A queue is a linear data structure that follows the First-In-First-Out (FIFO) principle, meaning the first element added to the queue is the first one to be removed. The two basic operations of a queue are:
- Enqueue (i):
- This operation adds an element to the rear (end) of the queue.
- Dequeue (ii):
- This operation removes an element from the front of the queue.
These two operations are fundamental for managing data in a queue.
Important Key Points:
- Enqueue Operation:
- Adds data to the rear of the queue.
- Example: Adding a person to the end of a line.
- Dequeue Operation:
- Removes data from the front of the queue.
- Example: Serving the first person in a line.
- Queue Characteristics:
- Follows FIFO (First In, First Out).
- Commonly used in real-life scenarios like printer queues, task scheduling, and CPU management.
Knowledge Booster:
- Option A: Only (i):
- Incorrect: Enqueue alone does not fulfill the queue operations without the ability to remove elements.
- Option B: Neither (i) nor (ii):
- Incorrect: Both operations are essential for a queue to function.
- Option D: Only (ii):
Incorrect: Dequeue alone without Enqueue makes the structure meaningless as no elements can be added.