Data Science Flashcards

1
Q

What does the acronym LIFO mean?

A

Last-in-first-out (LIFO) operations: 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(), which returns the “top” value of the stack without removing it.

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

What is Big O notation?

A

The Big O notation is used to express the upper bound of the runtime of an algorithm and thus measure the worst-case time complexity of an algorithm.

It is a way to measure an algorithm’s efficiency. It measures the time it takes to run your function as the input grows. Or in other words, how well does the function scale.

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

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

A

Pop values off the top until you access the value that matches what you’re looking for.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
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
6
Q

What methods are available on a Queue data structure?

A

Enqueue, dequeue, peek, print

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

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

A

Dequeue values until you reach that point, and enqueuing dequeued values if need be.

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