本文介绍了确定代码的时间复杂度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道详细的时间复杂性此代码
I want to know the time complixity in details for this code
展开 | 选择 | 换行 | 行号 推荐答案以及此代码的时间复杂性 and also the time complixity for this code pls 展开 | 选择 | Wrap | 行号
对于fun()的第一个平均复杂度,常量等于2. 第二个它太长了,没读过但是它的外观是河内塔的问题及其复杂性,例如在维基百科文章。 For the first average complexity of fun() is constant equals 2. The second it too long, didn''t read it but it''s looks Towers of Hanoi problem and its complexity is explained e.g. in wikipedia article.
此外,使用代码标签可以帮助其他人阅读并提供帮助。 Also, using the code tag would help others read it and provide help.
更多推荐
确定代码的时间复杂度
发布评论