1.

If the size of the array used to implement a circular queue is MAX_SIZE. How rear moves to traverse inorder to insert an element in the queue?(a) rear=(rear%1)+MAX_SIZE(b) rear=(rear+1)%MAX_SIZE(c) rear=rear+(1%MAX_SIZE)(d) rear=rear%(MAX_SIZE+1)I got this question during an online exam.I would like to ask this question from Data Structures-Queue topic in section java.util – The Collections Framework of Java

Answer»

The correct choice is (B) rear=(rear+1)%MAX_SIZE

The EXPLANATION is: The FRONT and rear POINTER od circular QUEUE point to the first element.



Discussion

No Comment Found

Related InterviewSolutions