Question 16
Back to Exercise
In an array-based circular queue of size capacity, how is the next tail index computed?
- A tail + 1
- B (tail + 1) % capacity Correct
- C tail * 2
- D (tail - 1) % capacity
Correct Answer: Option B
The modulo wraps the index from the last slot back to 0.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!