Data Structures Flashcards
What does the acronym LIFO mean?
last-in-first-out
What methods are available on a Stack data structure?
What must you do to access the value at an arbitrary point in a stack (not just the “top”)
What does the acronym FIFO mean?
first-in-first-out
What methods are available on a Queue data structure?
enqueue(value) - adds value to the “back” of the queue
dequeue( ) - removes the “front” value from the queue and returns it
peek( ); returns the “front” value
What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
postpone it until you get to it
How are linked lists different from an array?
They don’t have index you can access
How would you access an arbitrary node in a linked list (not just the “head”)?
What methods are available on a linked lists data structure?
.data - contains the node’s value
.next - reference to the next node in the list, if there is one. if there is no “next” node in the list, typically sets the property to null.