← 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?
- A.top == MAX
- B.top == MAX - 1
- C.top == 0
- 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 →