If an algorithm's behavior is bounded by "o(f(n)) if g(n)", what notation does…

2025

If an algorithm's behavior is bounded by "o(f(n)) if g(n)", what notation does it become when the condition is removed?

  1. A.

    o(f(n))

  2. B.

    o(g(n))

  3. C.

    o(f(n) + g(n))

  4. D.

    o(f(n) * g(n))

Attempted by 206 students.

Show answer & explanation

Correct answer: A

The notation "o(f(n)) if g(n)" describes an algorithm whose behavior is bounded by o(f(n)) only when the condition g(n) is true. This is a conditional asymptotic bound.

When the condition g(n) is removed, the restriction is lifted. The algorithm's behavior is then defined by its inherent bound, which is simply o(f(n)). The condition g(n) was merely a filter for when this bound applied, not part of the bound itself.

Explore the full course: Bpsc