Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sorting Algos :
- Bubble sort: Best : O(n),Average: O(n^2),worst : O(n^2)
- Insertion sort: Best : O(n),Average: O(n^2),worst : O(n^2)
- Quick Sort : Best : nlogn,Average: nlogn,worst : O(n^2)
- Merge Sort : Best : nlogn,Average: nlogn,worst : nlogn,space complexity : O(n)
- Heap Sort : Best : nlogn,Average: nlogn,worst : nlogn,space complexity : 1
- Graph Theory :
- BFS : Time O(n + m) where n is number of node and m is number of vertices,space O(n + m)
- DFS : O(n) where n is the number of nodes
- Dijkstra : O(V+Elog2V) where V is number of vertices and E is number of edges
- BellmanFord : O(V*E)
- Prims: O(Elog(V))
- Kruskal : O(ElogV)
- TSP : O(N^2 * 2^N)
Add Comment
Please, Sign In to add comment