Data Structures and Algorithms Flashcards
An ordered list in which the last element is added is the first element retrieved or removed. (LILO)
Stack
Adds an item to the top of the stack.
Push
Removes an item from the top of the stack.
Pop
Looks at the item at the top of the stack without removing it from the stack.
Peek (Java)
stack_name[-1] (Python)
Test whether the stack is empty.
isEmpty() (Java)
if not (Python)
A string that reads the same in either direction.
Palindrome
An ordered list in which the first element added is the first element to be retrieved or removed. (FIFO)
Queue
Adds an item into the queue.
Enqueue
Removes the head of the queue.
Dequeue
Retrieves the head of the queue. (Python)
Peek
Tests whether the queue is empty. (Python)
if not
Represents a hierarchical nature of a structure in a graphical form.
Tree
Top of a tree.
Root
Successor of a node.
Child nodes
The predecessor of a node.
Parent