In a circular queue implemented using an array of size 5, if front = 2 and…

2026

In a circular queue implemented using an array of size 5, if front = 2 and rear = 4, how many elements are currently in the queue ?

  1. A.

    2

  2. B.

    3

  3. C.

    4

  4. D.

    Cannot be determined

Attempted by 234 students.

Show answer & explanation

Correct answer: B

In a circular queue with front=2 and rear=4, elements are stored at indices 2, 3, and 4. The count is calculated as (rear - front + 1) = (4 - 2 + 1) = 3 elements.

Explore the full course: Niacl Ao It Specialist