Computer Science EngineeringHard

A circular queue is stored in an array of size 8 and uses the convention (rear+1) mod 8 == front for 'full'. Maximum number of elements it can hold is

  1. A. 7
  2. B. 8
  3. C. 6
  4. D. 9

Correct answer: A. 7

One cell is sacrificed to distinguish full from empty, leaving 7.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic