Classes and Stacks Flashcards

1
Q

Explain how data is “popped” from a stack

A

Data is read from the stack at the stack pointer, then the stack pointer is lowered by one.

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

Explain how data is “peeked” in a stack?

A

The data at the stack pointer is read.

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

How is data “pushed” to the stack?

A

The stack pointer is increased by one, then the data is written to the stack at the stack pointer.

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

How would you explain the stack?

A

The stack is a Last in First out (LIFO) process where the most recent data added is the next data to be overwritten in the stack

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