Stacks Flashcards

1
Q

Difference between static and dynamic data structure

A

Static has a fixed size
While dynamic can change

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

How do stacks behave

A

On a First In Last Out (FILO)

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

What are the 5 operations of a stack

A

Peek
Pop
Push
IsEmpty
IsFull

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

What does Peek do

A

Returns the top item without removing it

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

What does Pop do

A

Returns the top item and removes it

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

What does Push do

A

Adds a new item on top

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

What does IsEmpty do

A

Checks if the stack is empty

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

What does IsFull do

A

Check if the list is full.
*In python would be better to check the length as lists in python are dynamic

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