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).
Glossary: Data Structures and Algorithms in C++
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).