《算法导论》第四章-第4节_练习(参考答案)
来源:互联网 发布:汤臣倍健 鱼油 知乎 编辑:程序博客网 时间:2024/05/17 22:01
算法导论(第三版)参考答案:练习4.4-1,练习4.4-2,练习4.4-3,练习4.4-4,练习4.4-5,练习4.4-6,练习4.4-7,练习4.4-8,练习4.4-9
Exercise 4.4-1
Use a reccursion tree to determine a good asymptotic upper bound on the recurrence
T(n)=3T(⌊n/2⌋)+n . Use the substitution method to verify your answer.
假设
注:请看更正版,一个更好的渐进紧确界。
树高
代入法证明
更正:
代入法证明
Exercise 4.4-2
Use a reccursion tree to determine a good asymptotic upper bound on the recurrence
T(n)=T(n/2)+n2 . Use the substitution method to verify your answer.
树高
证明
得证。
Exercise 4.4-3
Use a reccursion tree to determine a good asymptotic upper bound on the recurrence
T(n)=4T(n/2+2)+n . Use the substitution method to verify your answer.
树高
注:以下递归树求解有误,请略过。看更正版(上图递归树形状不变,其中常数项代价需更改)
更正:
证明
得证
Exercise 4.4-4
Use a reccursion tree to determine a good asymptotic upper bound on the recurrence
T(n)=2T(n−1)+1 . Use the substitution method to verify your answer.
树高
证明
得证
Exercise 4.4-5
Use a reccursion tree to determine a good asymptotic upper bound on the recurrence
T(n)=T(n−1)+T(n/2)+n . Use the substitution method to verify your answer.
画图可知递归树不是完全二叉树,从
证明
得证
Exercise 4.4-6
Argue that the solution to the recurrence
T(n)=T(n/3)+T(2n/3)+cn , where c is a constant, isΩ(nlgn) by appealing to the recurrsion tree.
递归树直到
Exercise 4.4-7
Draw the recursion tree for
T(n)=4T(⌊n/2⌋)+cn , wherec is a constant, and provide a tight asymptotic bound on its solution. Verify your answer with the substitution method.
树高
证明
证明
得证
Exercise 4.4-8
Use a recursion tree to give an asymptotically tight solution to the recurrence
T(n)=T(n−a)+T(a)+cn , wherea≥1 andc>0 are constants.
树高
尝试用代入法,证明
证明
决策树给出了精确值,可是代入法证明失败了。
Exercise 4.4-9
Use a recursion tree to give an asymptotically tight solution to the recurrence
T(n)=T(αn)+T((1−α)n)+cn , where α is a constant in the range0<α<1 , andc>0 is also a constant.
类似练习4.4-6。假设
即
代入法证明
只要
所以
- 《算法导论》第四章-第4节_练习(参考答案)
- 《算法导论》第四章-第1节_练习(参考答案)
- 《算法导论》第四章-第2节_练习(参考答案)
- 《算法导论》第四章-第3节_练习(参考答案)
- 《算法导论》第四章-第5节_练习(参考答案)
- 《算法导论》第四章-第6节_练习(参考答案)
- 《算法导论》第五章-第4节_练习(参考答案)
- 《算法导论》第一章-第1节_练习(参考答案)
- 《算法导论》第一章-第2节_练习(参考答案)
- 《算法导论》第二章-第1节_练习(参考答案)
- 《算法导论》第二章-第2节_练习(参考答案)
- 《算法导论》第二章-第3节_练习(参考答案)
- 《算法导论》第三章-第1节_练习(参考答案)
- 《算法导论》第三章-第2节_练习(参考答案)
- 《算法导论》第五章-第1节_练习(参考答案)
- 《算法导论》第五章-第2节_练习(参考答案)
- 《算法导论》第五章-第3节_练习(参考答案)
- 《算法导论》第四章-思考题(参考答案)
- C/C++ Volatile关键词深度剖析
- 客户端与服务端的Socket通信
- 瞬时变化极性法
- Win10+tensorflow安装及学习1
- 线程池ThreadPoolExecutor使用简介
- 《算法导论》第四章-第4节_练习(参考答案)
- LeetCode 68 Text Justification(Python详解及实现)
- 467. Unique Substrings in Wraparound String
- leetcode 399. Evaluate Division
- JavaWeb-JDBC-1-不仅仅只是连接
- 从Web前端优化网站性能
- 详解浮点运算的定点编程
- Hibernate学习之---映射组件属性
- bayes python 源代码