0

For an algorithm with a run time of say, the form T(n) = 3n^2+ 2n + 5 I get that there can be multiple Big-O and Omega notations (like O(n^2) and O(n^3) in the given case).

But is it possible for a algorithm to have two Big-Thetha notations describing it? If yes, can you please give an explanation and if not, why not?

In other terms - Is it possible for two different functions to tightly bind the asymptotic running time of an algorithm?

Ayush
  • 81
  • 8
  • please read this: https://stackoverflow.com/a/12338937/6129793 – Peter Jul 22 '20 at 14:14
  • Constant factors don't matter, so Theta(f(n)) and Theta(5*f(n)) would be two different expressions (but they mean basically the same). – Henry Jul 22 '20 at 14:17
  • Hi, Ik what the different notations represent, probably my question is more mathematical, I wanna know if its possible for a function to have two different functions that tightly bind its running time – Ayush Jul 22 '20 at 14:17

1 Answers1

1

Yes, provided the two "Big-Theta" functions are Big-Theta to each other.

For example, the running time of Heapsort is both Θ(log n!) and Θ(n log n).

Yves Daoust
  • 53,540
  • 8
  • 41
  • 94