$ Implementation Of Circular Array Based Queue - [C++]

in this video when construct call then (front =0)
it mean queue have element but in initial stage front=-1

Hey @khemchandrs,

Though your description of the doubt is not clear, I have an answer to it.
Hope, this might help:

  1. You are creating a circular array.
    So, front will never be -1.

  2. front is used to specify the index(location) where we can add the element.
    So, first we insert an element to the queue and then we increment the front.
    so, front=0, doesn’t mean that queue has an element.
    it means the first index where we can insert an element is 0.

  3. Now, considering rare,
    the element is first deleted from the queue stored at index(location) indicated by rare then the rare is decremented.

Give a like if you are satisfied.

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.