I am confused now. Please guide me if I'm wrong. If NPTEL algo is correct then,
Lets take an example, size of queue = 5. (1 to 5 indices)
FRONT pointing to 3 and REAR pointing to 2.
According to algo,
Enqueue(Q, 5) :
now, FRONT = 3 and REAR = 3. and Queue is Full.
(here actually Index 3 is empty. only N-1 elements. right ?? )
now, FRONT = 3 but REAR = 4. Even when queue was full its overwriting the queue elements. REAR just passed the FRONT. It should not happen. Correct me please