Module 4: Stacks Flashcards

1
Q

is a data structure that stores and retrieves

items in a last-in-first-out (LIFO) manner.

A

stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

causes a value to be stored in (pushed onto)

the stack

A

push

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

retrieves and removes a value from the

stack

A

pop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A Boolean operation needed for
static stacks. Returns true if the stack is full.
Otherwise, returns false.

A

isFull:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A Boolean operation needed for all
stacks. Returns true if the stack is empty.
Otherwise, returns false.

A

isEmpty:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Fixed size

Can be implemented with an array

A

Static Stacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Grow in size as needed

Can be implemented with a linked list

A

Dynamic Stacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

may be implemented as a

vector, a list, or a deque

A

STL stack container

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Because the stack container is used to adapt

these other containers, it is often referred to as a

A

container adapter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly