Depth of complete binary tree?
Name Best case Worst case
complexity complexity
Linear search o(1) O(n) T(n)=T(n-1)+c
Binary search O(1) Log(n) T(n)=T(n/2) + 1
Jump search O(1) O(n1/2)
Fibonacci search Log(n) F(n) = F(n-1) + F(n-2)
exponential search O(1) Log(n)
Bubble sort O(n) O(n2)
Insertion sort O(n) O(n2) N(N-1)/4
Selection sort O(n2) O(n2)
Marge sort N log (n) N log (n) T(n) = 2T(n/2) + n
Quick sort N log (n) N2 T(n) <= T(n/4) + T(3n/4) + cn
Heap sort N log (n) N log (n)
Shell sort O(N2)
DFS =O(V + E) BFS= O(V + E)
Dfs space complexity = O(V)
List of greedy algorithms
List of dynamic algorithms
List of minimum spanning tree algorithms
Minimum Spanning Tree
Kruskal's Algorithm
PRIMS ALGORITHMPrim's Algorithm
List of shortest path algorithms
Dijkstra's Algorithm
Bellman-Ford Algorithm
FLOYD WARSHAL
Asymptotic notations
Graph theory
Total no of comparisons in bubble sort ?