Make an operation visible as a change of state
A program produces the result, but a student cannot yet explain why that particular item was removed next. Keep the contents before and after the operation together.
Work through a small input in the call, then open the implementation and connect each change to the code. Execution and debugging happen in your own development environment.
The same insertion order, a different removal rule
| Structure | Inserted | Removed first |
|---|---|---|
| Stack | A, B, C | C |
| Queue | A, B, C | A |
