Consider a standard circular queue ‘q’ implementation (which has same…

ISRO Scientist/Engineer SC · 2014 · Computer ScienceModified — slightly modified from the official paper; see the solution

Consider a standard circular queue ‘q’ implementation (which has same condition for queue full and queue empty) whose size is 11 and the elements of the queue are q[0], q[1], .... q[10]. The front and rear pointers are initialized to point at q[2]. Rear denotes the last occupied position and advances before each new element is stored. In which position will the ninth element be added?

  1. A.

    q[0]

  2. B.

    q[1]

  3. C.

    q[9]

  4. D.

    q[10]

Attempted by 963 students.

Show answer

Correct answer: A

The worked solution is available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…