algos Flashcards
What does the acronym LIFO mean?
last in, first out
What methods are available on a Stack data structure?
pop (removes the top value of the stack and returns it), push (adds a value to top of stack)
What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
pop the values
What does the acronym FIFO mean?
first in, first out
What methods are available on a Queue data structure?
enqueue (adds a value to the back of the queue), dequeue (removes a value from the front of the queue and returns it)
What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
dequeue
How are linked lists different from an array?
nodes != elements
How would you access an arbitrary node in a linked list (not just the “head”)?
using the .next
method