You are on page 1of 1

**could be O(n) with hash collisions and dynamic array

resizing but unlikely

Bellman-Ford
Fast Access O(1), tradeoff: more memory O(n)
Shortest Path?
Radix Sort
Dijkstra Hash Tables
Quick Sort
Breadth First Search (BFS)
Heap Sort

Improve Time Complexity? Bubble Sort


Cyclic or Acyclic? Sorting? ~ O(N log N)
Depth First Search (DFS)
Selection Sort
Inorder Weighted or Unweighted?
Graph Traversal? O(n)
Insertion Sort
Postorder Directed or Undirected? Collision?
Linked List
Merge Sort
Preorder
Counting Sort

Graphs

String question?
Turn it into an Array ~ split()
Be mindful of Space Complexity! (Stack overflow)
Tree Traversal? O(n)

Static
Recursion?

Tree Arrays
Singly Linked List Dynamic

Linked List Yes - Divide and Conquer - Binary search O(log N)


Searching. Is it sorted?
No. Will sorting make it faster? If still no, Linear Search
Doubly Linked List Array Stack ** can be O(n) on expanding memory

No. Is it a String? See if a Trie data structure helps


Linked List Stack
Stacks
Binary Tree
Binary Search Tree

AVL Tree
Balanced BST Heap
Red Black Tree
Binary Heap

Priority Queue Trie

Dynamic Programming Queues

Array Queue (BAD)

Memoization Linked List Queue

You might also like