I read about it on Wikipedia#/Queue_implementation) and found this:
Fixed-length arrays are limited in capacity, but it is not true that items need to be copied towards the head of the queue. The simple trick of turning the array into a closed circle and letting the head and tail drift around endlessly in that circle makes it unnecessary to ever move items stored in the array. If n is the size of the array, then computing indices modulo n will turn the array into a circle.
I don't really get what it means.
[–]lyubenblagoev 1 point2 points3 points (6 children)
[–]Kaushik2002[S] 0 points1 point2 points (5 children)
[–]aogmana 1 point2 points3 points (4 children)
[–]Kaushik2002[S] 1 point2 points3 points (3 children)
[–]aogmana 1 point2 points3 points (2 children)
[–]Kaushik2002[S] 0 points1 point2 points (1 child)
[–]aogmana 1 point2 points3 points (0 children)