Can I say that a Θ(n^3/2)-time algorithm is asymptotically slower than an Θ(n log n)-time algorithm?

StackOverflow https://stackoverflow.com/questions/21789407

  •  11-10-2022
  •  | 
  •  

Question

I analyzed an algorithm and for running time I got Θ(n3/2). Now I want to compare it with Θ(n log n) to see if it is asymptotically faster or slower, for that I did this:

Θ(n3/2) = Θ(n · n1/2)

If we compare them we will see that we need to compare the n1/2 and log n. I checked the growth of both and I found that for larger numbers the growth of n1/2 is more than log n. Can I say that n3/2 is asymptotically slower than log n?

Was it helpful?

Solution

Yes, you can. For any ε > 0, log n = o(nε) (that's little-o, by the way), so the log function grows asymptotically slower than any positive power of n. Therefore, n log n grows asymptotically slower than n3/2.

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top