What is the difference between lower bound and tight bound?

后端 未结 8 884
遇见更好的自我
遇见更好的自我 2020-12-04 04:56

With the reference of this answer, what is Theta (tight bound)?

Omega is lower bound, quite understood, the minimum time an algorithm may take. And we know Big-O is

8条回答
  •  清歌不尽
    2020-12-04 05:38

    Big O is the upper bound, while Omega is the lower bound. Theta requires both Big O and Omega, so that's why it's referred to as a tight bound (it must be both the upper and lower bound).

    For example, an algorithm taking Omega(n log n) takes at least n log n time, but has no upper limit. An algorithm taking Theta(n log n) is far preferential since it takes at least n log n (Omega n log n) and no more than n log n (Big O n log n).

提交回复
热议问题