Big-o icon, find the smallest

Give the lowest O () score for the following functions:

4n2 + 5n – 8 = O(...) log(n)2 + n = O(...) 

If you guys can explain the answer, rather than give it to me. A similar question will be in my medium term, and I want to understand this.

thanks

+4
source share
4 answers

When you have sums of terms, you should think of it as "slip one term into another?" So which of 4n 2 5n and 8 does the others join?

Second: log (n) 2 + n can be rewritten using the logarithmic laws: 2 * log (n) + n. The constants do not matter, so basically you need to figure out which one should be used when comparing log (n) and n. I am sure you know the answer here :-)

+4
source

Big-O notation is ordered as it gets more complicated, as described here at http://en.wikipedia.org/wiki/Big_O_notation , they have a nice table showing an ordered list of growing complexity if you have any further questions about this / were unsure of something.

+1
source

The designation is incorrect. The function is not equal to class O, the function is an element of class O

0
source

When summing equations: select "the heaviest." (The largest in asymptotic order).

If you like to test how this works with algebra, or using CAS, check this answer .

0
source

All Articles