Data Structures Flashcards
What does the acronym LIFO mean?
Last-in-first-out
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 operation
What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
Because of the LIFO rule. You must pop all the values above the arbitrary point in order to get access to it.
What does the acronym FIFO mean?
First-In-First-Out
What methods are available on a Queue data structure?
Enqueue, dequeue, and peek
What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
You must dequeue all the values above the arbitrary point in order to get access to it.
What is the time-complexity of a queue?
Linear time