O(n^2) 中但不在 Ω(n^2) 中的函数也在 Ω(n) 中但不在 O(n) 中
A function in O(n^2) but not in Ω(n^2) also in Ω(n) but not in O(n)
我正在研究我书中的渐近关系,但我不明白一个问题。
给出一个函数的例子,它在 O(n^2) 中但不在 Ω(n^2) 中,也在 Ω(n) 中但不在 O(n) 中。
有没有快速找到合适函数的方法?
试了很多例子还是找不到符合条件的完美函数
这是我试过的方法
cn < f(n) < cn^2
第一部分:
Give an example of a function that is in O(n^2) but not in Ω(n^2)
你可以说例如f(n) = n
第二部分:
Give an example of a function that is in Ω(n) but not in O(n)
你可以说g(n) = n^2
您还可以想出更多示例。
如果您希望同时满足两个条件:
Give an example of a function that is in O(n^2) but not in Ω(n^2) also in Ω(n) but not in O(n).
你可以说:h(n) = n^(1.5)
我正在研究我书中的渐近关系,但我不明白一个问题。
给出一个函数的例子,它在 O(n^2) 中但不在 Ω(n^2) 中,也在 Ω(n) 中但不在 O(n) 中。
有没有快速找到合适函数的方法?
试了很多例子还是找不到符合条件的完美函数
这是我试过的方法
cn < f(n) < cn^2
第一部分:
Give an example of a function that is in O(n^2) but not in Ω(n^2)
你可以说例如f(n) = n
第二部分:
Give an example of a function that is in Ω(n) but not in O(n)
你可以说g(n) = n^2
您还可以想出更多示例。
如果您希望同时满足两个条件:
Give an example of a function that is in O(n^2) but not in Ω(n^2) also in Ω(n) but not in O(n).
你可以说:h(n) = n^(1.5)