Print to P
Big-O Complexity Chart
Excellent Good Fair Bad Horrible
O(1) O(log n) O(n) O(n log n) O(n²) O(2ⁿ)
Elements →
🔄 Array Sorting Algorithms
🏗 Data Structures
🔍 Searching Algorithms
Algorithm Data Structure Time Complexity Space
Average Worst Worst
Depth First Search (DFS) Graph of |V| vertices and |E| edges - O(|E| + |V|) O(|V|)
Breadth First Search (BFS) Graph of |V| vertices and |E| edges - O(|E| + |V|) O(|V|)
Binary Search Sorted array of n elements O(log n) O(log n) O(1)
Linear (Brute Force) Array O(n) O(n) O(1)
Shortest path by Dijkstra (Min-heap) Graph with |V| vertices and |E| edges O((|V| + |E|) log |V|) O((|V| + |E|) log |V|) O(|V|)
Shortest path by Dijkstra (Unsorted array) Graph with |V| vertices and |E| edges O(|V|²) O(|V|²) O(|V|)
Shortest path by Bellman-Ford Graph with |V| vertices and |E| edges O(|V||E|) O(|V||E|) O(|V|)
🏔 Heap Data Structures
Heaps Time Complexity
Heapify Find Max Extract Max Increase Key Insert Delete Merge
Linked List (sorted) - O(1) O(1) O(n) O(n) O(1) O(m+n)
Linked List (unsorted) - O(n) O(n) O(1) O(1) O(1) O(1)
Binary Heap O(n) O(1) O(log n) O(log n) O(log n) O(log n) O(m+n)
Binomial Heap - O(log n)