I am just trying to figure out why
3^2500 < log(n) < 5log(n) < nlog(n^2) < nlog(n) < n^270
this is not true. This is from fastest to slowest.
Could anyone tell me why this is wrong?
I am confused with the middle part 5log(n) < nlog(n^2) < nlog(n)
Don't they share the same order of magnitude?
One more question,
sum = 0
for i in myIntegerList:
if i > 0:
sum += i
For this code fragment, the best case and the worst case would be O (n) right?
I am thinking that way because for loop will have a magnitude of n regardless
how many element myIntegerList contains? Also, there is no operation or
statement that results in the ending of the code.