Thursday, December 01, 2016

Steve Skiena Algorithm Complexity

n! > 2^n > n^3 > n^2 > nlogn > n > logn > 1

1 : Adding 2 numbers
log(n) :
n : sweeping through an array of elements
n*log(n) : Heap sort
n^2 : Bubble sort
n^3 : Matrix multiplication
2^n : enumerating all subsets of a given set
n! : enumerating all permutations (Eg. perfect solution to travelling salesman problem)

https://youtu.be/ZJfRrGlMXp4?list=PLOtl7M3yp-DV69F32zdK7YJcNXpTunF2b

No comments: