In a circular queue of size n, one slot is kept empty to distinguish a full queue from an empty one. What is the maximum number of elements it can hold?
- A n
- B n - 1
- C n + 1
- D n / 2
Explanation
Because one slot is deliberately left unused so that full and empty states can be told apart, a circular queue of size n holds at most n - 1 elements.