Practice
Learn
← Quit
0 / 0 correct
Data Structures
Hard
1 of 20
A circular buffer of capacity N uses head and tail indices. How do you distinguish full from empty?
A
Track a count (or keep one slot always empty), since head == tail is ambiguous otherwise
B
Check if the first element is zero
C
Use a separate hash set
D
They can't be distinguished