Skip to content

Glossary: Coding Interviews in Java

Stack

Also written: push, pop, peek

A last-in, first-out collection used for 'most recent', 'undo' and canceling problems. Alex's scanner cancels repeat scans by comparing each item to the top of a stack.

Where the book teaches it

Related terms

ArrayDequeMonotonic stack