Difference between Big-Theta and Big O notation in simple language

后端 未结 6 984
既然无缘
既然无缘 2020-12-04 09:08

While trying to understand the difference between Theta and O notation I came across the following statement :

The Theta-no         


        
6条回答
  •  半阙折子戏
    2020-12-04 09:52

    If the running time is expressed in big-O notation, you know that the running time will not be slower than the given expression. It expresses the worst-case scenario.

    But with Theta notation you also known that it will not be faster. That is, there is no best-case scenario where the algorithm will retun faster.

    This gives are more exact bound on the expected running time. However for most purposes it is simpler to ignore the lower bound (the possibility of faster execution), while you are generally only concerned about the worst-case scenario.

提交回复
热议问题