Professional Documents
Culture Documents
A LG O R I T H M D E I G N A N D A N A LY S I S
g(n) is an asymptotic tight lower bound for f(n). Our objective is to give
the largest rate of growth g(n) which is less than or equal to the given
algorithm’s rate of growth f(n).
Example 1:
Therefore:
f(n) = 2n + 3 f(n) : Θ(n)
1*n ≤ 2n+ 3 ≤ 5*n
Example 2
Best Case
Worst Case
Average Case
Linear Search A 9 12 8 5 17 7 13 4 14 15
Linear Search A 9 12 8 5 17 7 13 4 14 15
Linear Search A 9 12 8 5 17 7 13 4 14 15
B(n) = 1 W(n) = n
B(n) = O(1) W(n) = O(n)
B(n) = Ω(1) W(n) = Ω(n)
B(n) = Θ(1) W(n) = Θ(n)