Skip to content

Glossary: Data Structures and Algorithms in Rust

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) on a stack.

Where the book teaches it

Related terms

StackOption