-5

enter image description here

I believe it is 3n+5n^2+1 but I am not 100 percent sure. If I am wrong can someone explain to me why?

hotrod28
  • 45
  • 8

1 Answers1

3

3n + 5n^2 + 1 | applying Big-O notation for the single terms

= O(3n) + O(5n^2) + O(1) | leaving out constant multipliers

= O(n) + O(n^2) + O(1) | taking the one with the maximum power

= O(n^2)

=> quadratic time

So you are right, the first option is the quadratic one.

If it was 3n + 5n^(2 + 1), then it would be qubical due to 5^(2 + 1) = 5^3.

deHaar
  • 17,687
  • 10
  • 38
  • 51