Data Science Flashcards
What does the acronym LIFO mean?
Last-in-first-out (LIFO) operations: the last thing pushed onto the stack is the first thing that can be popped out.
What methods are available on a Stack data structure?
Push(), pop(), and peek(), which returns the “top” value of the stack without removing it.
What is Big O notation?
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.
What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
Pop values off the top until you access the value that matches what you’re looking for.
What does the acronym FIFO mean?
First in, first out
What methods are available on a Queue data structure?
Enqueue, dequeue, peek, print
What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
Dequeue values until you reach that point, and enqueuing dequeued values if need be.