This is a Data Structures question involving time complexity
This is a Data Structures question involving time complexity analysis...
Explain the meaning of the following expressions:
Explain the meaning of the following expressions: f (n) is O(n^2) f (n) is Ohm(n^2) f (n) is Theta(n^2)Solution
Answer:
a) f(n) = O(n^2)
It means that if we have any function f(n) and g(n) = n^2 then f(n) < = c * g(n) at c > 0 , in other words g(n) is tightest bound of f(n)
b) f(n) is Omega(n^2)
It means that f(n) > = c * g(n) , c > 1 and g(n) = n^2
c) f(n) is theta(n^2)
It means that c1 * g(n) < = f(n) < = c1 * g(n) , where c1 and c2 > 1 and g(n) = n^2.
