Application of Stack
Application of Stack sits in a tiny editor. Farhan’s job is undo typing. Write that first.
Application of Stack on the board — push / pop LIFO. Then say what undo typing looks like after.
Application of Stack exists so Farhan can keep undo typing correct in a tiny editor.
Application of Stack shows up in a tiny editor. Name undo typing, not “a real-world scenario”.
Application of Stack trap — pop on empty. Farhan loses marks for that every viva.
After Application of Stack, Farhan should still remember pop on empty.
One breath for Application of Stack, then undo typing, then pop on empty. Sit down.
| 3 | ← top (pop)
| 2 |
| 1 |
LIFOBoard: undo typing. Dry-run Application of Stack. Name the trap: pop on empty.