Skip to content

Glossary: Data Structures and Algorithms in C++

Push, pop, peek

Also written: push, pop, peek

Push adds an item to the top of a stack, pop removes the top item, and peek looks at it without removing it. All are O(1).

Where the book teaches it

Related terms

StackFIFO, LIFO