Stacks: LIFO (Last In First Out) Used for backtracking problems to remember tasks or paths visited, and to undo actions * decimal to binary problem * the balanced parenthesis problem * the tower of Hanoi problem
Queues: FIFO (First In First Out)
- Priority queue
- Circular queue i.e. Hot Potato Game
Linked-lists: consists of nodes that point a reference to the next element; advantage over an array is that you can easily add/remove elements without shifting over its elements. Variations:
- doubly
- circular
- doubly circular
Sets: unordered, unique sequential data structure -- DOES NOT ALLOW DUPLICATES VALUES [key, key]
- Union
- Intersection
- Difference
- Subset
Maps/Dictionaries: [key, value] Hashes/HasheTables/HashMaps: constant time look-up (NON-SEQUENTIAL)
- handle hashTable collision with linear probing or linked list implementation
WeakMaps/WeakSets: similar to their non-Weak conterparts with omited iterator methods; only possible to use objects as keys; weakly typed, which means is possible for garbage collection for performance.
Trees: non-sequential data structure that is useful for storing information that need to be found easily; hiearchyal relationship; Tree traversal:
- In-order traversal
- Pre-order traversal: visits the node prior to its descendants
- Post-order traversal: visits the node after it visits its descendants
Searching for values in a tree
- Searching for the min value
- Searching for the max value
- Searching for a specific value
Graphs: non-linear data structure; abstract model of a network struture; a set of nodes connected by edges.