🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Stack and Queue in C: all 10 questions

Quiz: Stack and Queue in C · Question 3 of 10

In an array stack with top starting at -1 and size MAX, when is the stack full?

In an array stack with top starting at -1 and size MAX, when is the stack full?

  1. A.top == MAX
  2. B.top == MAX - 1
  3. C.top == 0
  4. D.top == -1
Answer & explanation

Correct answer: top == MAX - 1

The last valid index is MAX - 1.

Can you get the rest right without peeking?

Take the timed Quiz: Stack and Queue in C quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →