f(n) is in O(g(n)) means there exist constants c > 0 and n_0 ≥ 0 such that for all n ≥ n_0,
Af(n) = c · g(n) exactly
Bf(n) ≤ c · g(n)
Cf(n) ≥ c · g(n)
Df(n) > c · g(n)
Answer & Solution
Correct answer: B. f(n) ≤ c · g(n)
**Big-O is an upper bound:** f(n) ≤ c · g(n) for some positive constant c and all sufficiently large n.
Equality is Theta (tight)
the ≥ inequality is Omega (lower bound)
strict > is not how the bound is defined.
Keep practising Algorithms
Browse all Algorithms questions for GATE CSE, or explore more Computer Science topics.