Computational Complexity of Algo
Computational Complexity of Algo
Complexity of
Algorithm
Group 5
Computational Complexity
BACK NEXT
Ex:
HELLO
BACK NEXT
EX:
Discretemath
I Like Discretemath!
BACK NEXT
BIG O
BACK NEXT
GRAPH
# COMPUTATIONS
Constant- 0 (1)
INPUT SIZE N
BACK NEXT
DESCRIPTION
Constant O(1)
[1, 2, 5]
BACK NEXT
GRAPH
# COMPUTATIONS
Logarithmic - 0 (log(n))
Constant- 0 (1)
INPUT SIZE N
BACK NEXT
DESCRIPTION
Logarithmic - O(log(n))
Runtime grows slower than input size.
Example: Binary Search
BACK NEXT
GRAPH
# COMPUTATIONS
Linear - 0(n)
Logarithmic - 0(log(n))
Constant- 0(1)
INPUT SIZE N
BACK NEXT
DESCRIPTION
Linear - O(n)
BACK NEXT
GRAPH
# COMPUTATIONS
Log-Linear - 0(n log(n))
Linear - 0(n)
Logarithmic - 0(log(n))
Constant- 0(1)
INPUT SIZE N
BACK NEXT
DESCRIPTION
BACK NEXT
GRAPH
Quadratic - O (n^2)
# COMPUTATIONS
Log-Linear - 0(n log(n))
Linear - 0(n)
Logarithmic - 0(log(n))
Constant- 0(1)
INPUT SIZE N
BACK NEXT
DESCRIPTION
Quadratic - O(n^2)
BACK NEXT
GRAPH
Quadratic - O (n^2)
# COMPUTATIONS
Log-Linear - 0(n log(n))
..
)..
^3
Linear - 0(n)
(n
O
- l
ia
m
no
ly
Po
Logarithmic - 0(log(n))
Constant- 0(1)
INPUT SIZE N
BACK NEXT
DESCRIPTION
Polynomial - O(n^3)...
BACK NEXT
GRAPH
Exponential - O(2^n)
Quadratic - O pi(n^2)
# COMPUTATIONS
Log-Linear - O(n log(n))
..
)..
^3
Linear - O(n)
(n
O
- l
ia
m
no
ly
Po
Logarithmic - O(log(n))
Constant- O(1)
INPUT SIZE N
BACK NEXT
DESCRIPTION
Exponential - O(2^n)
Worse:
O(n!)
Exponential - O(2^n)
Quadratic - O pi(n^2)
# COMPUTATIONS
Log-Linear - O(n log(n))
..
)..
^3
Linear - O(n)
(n
O
-l
ia
m
no
ly
Po
Logarithmic - O(log(n))
Constant- O(1)
INPUT SIZE N
BACK NEXT
DESCRIPTION
Worse: O(n!)
Ex: Permutations.
Runtimes can be infinite.
BACK NEXT
Multiple Input Dimensions
BACK NEXT
Complexity Implications