Overflow or underflow
Exercise and reference answers
- Categories
- Overflow
- Underflow
- Questions
- Answer
- Overflow
- Question
- Push onto a full stack
- Answer
- Underflow
- Question
- Pop from an empty stack
- Answer
- Overflow
- Question
- Enqueue beyond capacity
- Answer
- Underflow
- Question
- Dequeue an empty queue
- Answer
- Overflow
- Question
- No space left to add
- Answer
- Underflow
- Question
- Nothing left to remove
- Instructions
- Pull each case towards the exception it raises.
Explanation
_Source: syllabus Computer Science, Ch 3 'Stack' and Ch 4 'Queue'_