Below are some common Big-O functions while analyzing algorithms.
- O(1) - constant time
- O(log(n)) - logarithmic time
- O((log(n))c) - polylogarithmic time
- O(n) - linear time
- O(n2) - quadratic time
- O(nc) - polynomial time
- O(cn) - exponential time
- O(n!) - factorial time
(n = size of input, c = some constant)
Here is the model graph representing Big-O complexity of some functions
No comments:
Post a Comment