1

I have the following functions:

enter image description here

  1. What is the correct order of these functions in increasing complexity?

  2. I could always start entering values in these functions and check the corresponding output to notice the rate of increase. But is there a better, faster way of ranking these functions in order of increasing complexity? For example are there rules of thumb I could use to quickly sort these in order of increasing complexity? (Like I know generally exponential functions are more complex than log functions)

learnerX
  • 137
  • 1
  • 2
  • 10

1 Answers1

2

I solved it after understanding asymptotic notation and the complexity of some common functions. Here's the order from least expensive to most expensive:

log log n, log n ~ ln n, (log n)^2, sqrt(n), n, n log n, n^(1+x), n^2, n^3, n-n^3+7n^5, 2^(n-1) ~ 2^n, e^n, n!

learnerX
  • 137
  • 1
  • 2
  • 10