Machine-translated by Google. Questions are authored in English.
Top

Discussion

If(n) = 2 ×n2 + 5 × n + 3, then big Oh notation for the function f(n) is

  • A.O(n)
  • B.O(log n)
  • C.O(1)
  • D.None of the above

Answer: D

The function is O(n2), which is not offered, so the answer is None of the above.

Big O keeps the fastest-growing term and drops constants. For n ≥ 1:

\[ \begin{aligned} f(n) &= 2n^{2} + 5n + 3 \\ &\le 2n^{2} + 5n^{2} + 3n^{2} = 10n^{2} \end{aligned} \]

So f(n) = O(n2). O(n), O(log n) and O(1) all grow more slowly than n2, so none of them can bound f(n) for large n.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.