Exam-style question
Try this first
A stack has reached its maximum capacity. Which test should be made before attempting to add another value?.
- A.Test for stack full
- B.Test for empty stack
- C.Peek at the bottom element
- D.Pop the top value
Model answer
What a good answer should say
- Test for stack full
Explanation
Why this works
The test for stack full determines whether the stack has reached its maximum capacity before another value is pushed.
Common mistake
No common mistake is linked to this question yet.
