Module 4: Stacks Flashcards
is a data structure that stores and retrieves
items in a last-in-first-out (LIFO) manner.
stack
causes a value to be stored in (pushed onto)
the stack
push
retrieves and removes a value from the
stack
pop
A Boolean operation needed for
static stacks. Returns true if the stack is full.
Otherwise, returns false.
isFull:
A Boolean operation needed for all
stacks. Returns true if the stack is empty.
Otherwise, returns false.
isEmpty:
Fixed size
Can be implemented with an array
Static Stacks
Grow in size as needed
Can be implemented with a linked list
Dynamic Stacks
may be implemented as a
vector, a list, or a deque
STL stack container
Because the stack container is used to adapt
these other containers, it is often referred to as a
container adapter.