Push and Pop
noun
say it: “PUSH and POP” /pʊʃ ənd pɑp/
The two main stack operations: push puts an item on top, and pop takes the top item off.
What is push and pop?
Push and pop are a stack's two main operations: push puts an item on top, and pop takes the top item off and gives it back. Both work only at the top, so both are O(1). JavaScript's arrays and Java's ArrayDeque use these names; Python's list uses append and pop.
In a sentence
- “The bracket checker uses push and pop: push each opening bracket, pop when a closing one arrives.”
Level: Apprentice · More Data Structures terms at this level
Updated