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)

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