Complexity analysis – Big o notation table

Searching Algorithm Data Structure Time Complexity Space Complexity 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 … More Complexity analysis – Big o notation table