Correct option is A
In a queue of fixed size, two major conditions can occur during its operation:
- Underflow happens when we try to delete (dequeue) an element from an empty queue.
- Overflow occurs when we try to insert (enqueue) an element into a queue that is already full.
Since the queue has a fixed size, there is a maximum limit to how many elements it can store. Therefore, both conditions are possible depending on the queue's current state.
Important Key Points:
- Fixed-size queues have a defined maximum capacity and do not auto-expand like dynamic structures.
- Underflow is related to deletion from an empty queue.
- Overflow is related to insertion into a full queue.
Knowledge Booster:
- Neither Overflow nor Underflow: This is not possible for fixed-size queues — both errors can occur in practice.
- Underflow: Only occurs when the queue is empty and a dequeue operation is attempted — not the only condition possible.
- Overflow: Only occurs when the queue is full and an enqueue operation is attempted — again, not the only condition.