We are just learning about circular queue in class, and I got a few questions. Since we define the tail as the empty space next to the last value, such as shown below:
|1| |3|4|5|6|
The head will be pointing to the number 3, and the tail will be pointing to the empty space between 1 and 3. I am confused on what happens if that space is filled up, so for example below:
|1|2|3|4|5|6|
Then the head will still be pointing to 3, but the tail needs to be pointing to the next box after the blank box before, thus it will be pointing to 3, or the header. What should I do about this?