Redian新闻
>
求助推荐美白去斑和美白去皱抗皱的化妆品
avatar
求助推荐美白去斑和美白去皱抗皱的化妆品# Fashion - 美丽时尚
i*t
1
f(n) = f(n-1)+f(n-2)
所以总共树的高度是 n , 每i层的节点数 2^i
所以总共节点数 2^0 + 2^1 +... +2^n >2^n
所以
错略复杂度是 THETA(2^n)

所以是 np-hard 问题?
avatar
M*s
2
请求这里有经验的达人介绍些美白/去斑和美白/去皱/抗皱的产品。要回国送礼,孝敬
我两个丈母娘(请别想歪,一个是老婆的亲妈,一个是干妈)。
老婆亲妈年纪稍大,所以想送美白/去皱/抗皱的。老婆干妈稍较年轻,只是脸上常有雀
斑,所以想送美白/去斑的。另外,如有什么好的保养,护肤之类的,也请多告知,具
体的品牌和产品最好。希望我这个老大粗这次可以成功给她们一个惊喜。多谢了。
avatar
a*u
3
复杂度是O(n)
念order of,不是theta
Np-hard好像也不是你说的那样定义的

★ 发自iPhone App: ChineseWeb 7.8

【在 i******t 的大作中提到】
: f(n) = f(n-1)+f(n-2)
: 所以总共树的高度是 n , 每i层的节点数 2^i
: 所以总共节点数 2^0 + 2^1 +... +2^n >2^n
: 所以
: 错略复杂度是 THETA(2^n)
: ?
: 所以是 np-hard 问题?

avatar
i*t
4
O(n) 是 big O啊 还有个 Theta啊

【在 a*****u 的大作中提到】
: 复杂度是O(n)
: 念order of,不是theta
: Np-hard好像也不是你说的那样定义的
:
: ★ 发自iPhone App: ChineseWeb 7.8

avatar
a*u
5
theta是什么?上下限吗?一般面试big O就行了吧,不需要上下限吧

★ 发自iPhone App: ChineseWeb 7.8

【在 i******t 的大作中提到】
: O(n) 是 big O啊 还有个 Theta啊
avatar
a*u
6
网上查的
Big-O is an upper bound.
Big-Theta is a tight bound, i.e. upper and lower bound.
When people only worry about what's the worst that can happen, big-O is
sufficient; i.e. it says that "it can't get much worse than this". The
tighter the bound the better, of course, but a tight bound isn't always easy
to compute.
Fibonacci 的upper bound肯定是O(n)的

★ 发自iPhone App: ChineseWeb 7.8

【在 a*****u 的大作中提到】
: theta是什么?上下限吗?一般面试big O就行了吧,不需要上下限吧
:
: ★ 发自iPhone App: ChineseWeb 7.8

avatar
i*t
7
一个是 big O 还有个 sigma 还有个 theta
。。。
theta 和 O正好相反
sigma 是 加中间。。。

【在 a*****u 的大作中提到】
: theta是什么?上下限吗?一般面试big O就行了吧,不需要上下限吧
:
: ★ 发自iPhone App: ChineseWeb 7.8

avatar
e*w
8
fibonacci是O(log n).

【在 i******t 的大作中提到】
: 一个是 big O 还有个 sigma 还有个 theta
: 。。。
: theta 和 O正好相反
: sigma 是 加中间。。。

avatar
b*5
9
是O(n)吧。 怎么搞O(lgn)?

【在 e*****w 的大作中提到】
: fibonacci是O(log n).
avatar
L*e
10
NP-hard不是这么定义的,Fibonacci这种有closed form solution的问题在theory里应
该算O(1)
avatar
i*t
11
我说错了
我应该说的是 这种用原始递归做的时候的复杂度 是 大约 2^n
用 DP 是可以o(n)的
还有个方法是 logn

easy

【在 a*****u 的大作中提到】
: 网上查的
: Big-O is an upper bound.
: Big-Theta is a tight bound, i.e. upper and lower bound.
: When people only worry about what's the worst that can happen, big-O is
: sufficient; i.e. it says that "it can't get much worse than this". The
: tighter the bound the better, of course, but a tight bound isn't always easy
: to compute.
: Fibonacci 的upper bound肯定是O(n)的
:
: ★ 发自iPhone App: ChineseWeb 7.8

avatar
b*5
12
怎么搞O(lgn)

【在 i******t 的大作中提到】
: 我说错了
: 我应该说的是 这种用原始递归做的时候的复杂度 是 大约 2^n
: 用 DP 是可以o(n)的
: 还有个方法是 logn
:
: easy

avatar
L*e
13
[fn+1]=[1, 1][fn ]
[fn ] [1, 0][fn-1]
然后参考矩阵乘积的logn解法。

【在 b**********5 的大作中提到】
: 怎么搞O(lgn)
avatar
w*s
14
别搞什么O(logN)了。你要是较真的话,既然写成矩阵,还可以算矩阵的特征值和特征
向量,然后可以可以写出通项公式,那就是O(1)了。有兴趣可以翻翻组合数学的书。方
法我还记得,但特征值不记得了。好像跟黄金分割有关。所以我们写程序O(N)就可以了
avatar
B*5
15
那请问如何在O(1)算根号5的n次方?

【在 w**s 的大作中提到】
: 别搞什么O(logN)了。你要是较真的话,既然写成矩阵,还可以算矩阵的特征值和特征
: 向量,然后可以可以写出通项公式,那就是O(1)了。有兴趣可以翻翻组合数学的书。方
: 法我还记得,但特征值不记得了。好像跟黄金分割有关。所以我们写程序O(N)就可以了
: 。

avatar
c*p
16
我太笨了,不得不用一个数来试了一下,发现是2^n
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。