data structures Flashcards
What does the acronym LIFO mean?
Last-In-First-Out
What methods are available on a Stack data structure?
push, pop, peek(maybe), print(maybe)
What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
keep popping until you find the item
What does the acronym FIFO mean?
First-In-First-Out
What methods are available on a Queue data structure?
enqueue and dequeue
What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
dequeue until you get where you want to get
How are linked lists different from an array?
you don’t have direct access when looking through a linked list, only what’s currently in front
How would you access an arbitrary node in a linked list (not just the “head”)?
jump through the next in the list until you find it