data-structures Flashcards
What does the acronym LIFO mean?
last in first out
What methods are available on a Stack data structure?
push(value), pop( ), sometimes peek( )
What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
remove the top values in order to access the value you want
What does the acronym FIFO mean?
First in first out
What methods are available on a Queue data structure?
enqueue(value), dequeue( ), sometimes peek( )
What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
Remove the top values in order to access the value you want
How are linked lists different from an array?
Linked lists have sequential access, not random access like arrays
How would you access an arbitrary node in a linked list (not just the “head”)?
Use .next to find the node