Data Structures Flashcards

1
Q

What does the acronym LIFO mean?

A

Last-in-first-out
the last thing pushed onto the stack is the first thing that can be popped out.

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

What methods are available on a Stack data structure?

A

Push, pop, and peek operation

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

What must you do to access the value at an arbitrary point in a stack (not just the “top”)?

A

Because of the LIFO rule. You must pop all the values above the arbitrary point in order to get access to it.

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

What does the acronym FIFO mean?

A

First-In-First-Out

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

What methods are available on a Queue data structure?

A

Enqueue, dequeue, and peek

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

What must you do to access the value at an arbitrary point in a queue (not just the “front”)?

A

You must dequeue all the values above the arbitrary point in order to get access to it.

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

What is the time-complexity of a queue?

A

Linear time

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