data-structures Flashcards
What does the acronym LIFO mean?
last in first out
What methods are available on a Stack data structure?
pop, push, peek,
What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
use the pop method which is destructive til you get to the value you want. if you don’t want to mutate it you would need to pop and save it to a variable get the value you want and push the popped values back in the stack.
What does the acronym FIFO mean?
What methods are available on a Queue data structure?
What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
How are linked lists different from an array?
Linked lists are sequential access not random access
How would you access an arbitrary node in a linked list (not just the “head”)?