Data Structures Flashcards
What does the acronym LIFO mean?
Last in, first out
What methods are available on a Stack data structure?
peek(), which returns the “top” value of the stack without removing it.
print() for debugging.
push() which adds an element to the top of stack.
pop() which removes an element from top of stack.
What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
Gotta pop it to make it
What does the acronym FIFO mean?
First in First Out
What methods are available on a Queue data structure?
Peek()
EnQueue()
Dequeue()
What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
Gotta DQ it to Get it.
How are linked lists different from an array?
Linked list relies on references where each node consists of the data and the references to the previous and next element.
How would you access an arbitrary node in a linked list (not just the “head”)?
next next next and more next