Big O, Big Omega and Big Theta Notation: Prepared By: Engr. Wendell Perez
Big O, Big Omega and Big Theta Notation: Prepared By: Engr. Wendell Perez
Theta Notation
Prepared by: Engr. Wendell Perez
Complexity of Algorithm
Analysis of an Algorithm – It is a process of deriving
estimates for the time and space needed to execute the
algorithm.
Complexity of an Algorithm – It is the amount of time
and space required to execute the algorithm.
Output: From the input values, the algorithm produces the output values from a
specified set. The output values are the solution.
Correctness: An algorithm should produce the correct output values for each set of
input values.
Finiteness: An algorithm should produce the output after a finite number of steps for
any input.
Effectiveness: It must be possible to perform each step of the algorithm correctly and in
a finite amount of time.
Generality: The algorithm should work for all problems of the desired
Continuation
A reasonable definition of the size of input for the
algorithm that finds the largest value of a finite
sequence is the number of elements in the input
sequence.
|ƒ (n)| ≤ C1 | (g (n)) |
We write
ƒ (n) = Ω (g (n)) (Big Omega Notation)
Continuation
and say that ƒ (n) is of order at least g(n) if there exist a
positive constant C2 such that
|ƒ (n)| ≤ C2 | (g (n)) |
We write
ƒ (n) = θ (g (n)) Big Theta Notation
60n2 + 5n + 1 = O (n2)