Let's say I implement a circular queue using an array. How could I calculate the size of the queue? By size I mean the number of elements between the front and the rear. I want to use the modulo operation.
I have the capacity of the array, and the positions of the front and the rear of the queue. I don't known what to do now.