0 votes 0 votes Doubt: dequeue really deletes the element or just moves the pointer? I'm not getting the answer. DS data-structures queue circular-queue + – target2017 asked Jan 21, 2017 target2017 933 views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply Roshan Pawar commented Mar 25, 2017 i edited by Roshan Pawar Mar 25, 2017 reply Follow Share Something is wrong with the question itself. If array indices are from 0 to 4, means it can only hold 5 elements and NOT 6 as given in the question. About your doubt : The number of elements present in the queue is counted from front to rear. So moving the pointer and deleting the element have the same meaning. Actually moving the pointer itself auto deletes the element as it no longer present between front and rear. 2 votes 2 votes Anand. commented Mar 25, 2017 reply Follow Share is answer 1? i.e number of lement in the queue=1 which is 2. 1 votes 1 votes Roshan Pawar commented Jun 9, 2017 reply Follow Share Yes the correct answer is 1 element will remain in the queue. its 2. Both front and rear will point to this element. 1 votes 1 votes rajputved commented Jun 11, 2017 reply Follow Share i think 1 are the remaining element in the queue because (Q->rear+1)%Q->capacity (4+1)%6 ___top element are shift one place 0 votes 0 votes `JEET commented Nov 19, 2019 reply Follow Share @techbd123 Checkout this question, please. 0 votes 0 votes techbd123 commented Nov 19, 2019 reply Follow Share What @Roshan Pawar said in the first comment is absolutely right. The question has a problem. It should say the array had indices from $0$ to $5$ as it could hold $6$ elements. Besides, the question is similar to this. 0 votes 0 votes `JEET commented Nov 20, 2019 reply Follow Share Right. Thanks. 0 votes 0 votes Please log in or register to add a comment.