What is the difference between lower bound and tight bound?

后端 未结 8 858
遇见更好的自我
遇见更好的自我 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:51

    Asymptotic upper bound means that a given algorithm executes during the maximum amount of time, depending on the number of inputs.

    Let's take a sorting algorithm as an example. If all the elements of an array are in descending order, then to sort them, it will take a running time of O(n), showing upper bound complexity. If the array is already sorted, the value will be O(1).

    Generally, O-notation is used for the upper bound complexity.


    Asymptotically tight bound (c1g(n) ≤ f(n) ≤ c2g(n)) shows the average bound complexity for a function, having a value between bound limits (upper bound and lower bound), where c1 and c2 are constants.

    0 讨论(0)
  • 2020-12-04 05:53

    If you have something that's O(f(n)) that means there's are k, g(n) such that f(n)k g(n).

    If you have something that's Ω(f(n)) that means there's are k, g(n) such that f(n)k g(n).

    And if you have a something with O(f(n)) and Ω(f(n)), then it's Θ(f(n).

    The Wikipedia article is decent, if a little dense.

    0 讨论(0)
提交回复
热议问题