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