[Link].
Approach Problems Time Complexity
1 Divide and Binary Search Successful :
Conquer Best - O(1)
Avg - O(log n)
Worst - O(log n)
Unsuccessfull :
Best, Avg, Worst-O(log n)
Quick Sort Best - O(nlog n)
Avg - O(nlog n)
Worst - O(n^2)
Merge Sort Best - O(nlog n)
Avg - O(nlog n)
Worst - O(nlog n)
Strassen’s matrix O(n^log2(7)) ≅ O(n^2.81)
Multiplication
2 Dynamic Optimal binary O(n^3)
Programming search trees
All pairs shortest O(n^3)
path problem
0/1 knapsack O(n*w) ,Where
problem n = number of items
available
w = capacity of the knapsack
Travelling O(2^n * n^2)
salesperson problem
Optimal rod cutting Top down approach -
O(n^2)
Bottom up approach -
O(n^2)
[Link] Approach Problems Complexity
3 Greedy Job sequencing with O(2^n)
Method deadlines problem
Fractional knapsack O(nlog n)
problem
Minimum cost spanning Prim’s Algorithm :
trees
Adjacency Matrix - O(n^2)
Adjacency List -
O(log n)
Kruskal’s Algorithm :
O(log n)
Single source shortest O(n^2)
paths problem
Activity selection Unsorted – O(nlog n)
problem
Sorted – O(n)
4 Backtracking n-queens problem O(n!)
sum of subsets problem O(2^n)
Hamiltonian cycles O(n!)
5 Branch and Travelling sales person Worst Case - O(n!)
Bound problem with LCBB
0/1 knapsack problem : LC branch and bound :
1. LC branch and Worst Case - O(2^n)
bound solution.
Average Case -O(nlog n)
2. FIFO branch and
bound solution FIFO branch and bound:
O(2^n)