Queue using array

sir, in the video
for (int i=1; i<=6;i++)
sir has told that when we push data in the .last index after that pointer will go to 0 index. So when we push data now, shouldn’t it overwite the 0th index from 1 to 6 as sir has initially limited the member Queue(int ds=5) { } and then when sir popped the two elements, then 6 and 2 are popped rather than 1 2 . But why sir is saying that due to size =5 , the value 6 is not added anywhere.

can you mention the time stamp where you are getting issue in understanding? will help you accordingly.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.