There are there main methods to solve this problem.
1. substitution method
1.1 guess the form of solution, the recursion-tree method can help to get a good guess
1.2 use mathematical induction to find the constants and show that the solution works
2. The recursion-tree method
2.1 compute the height of the tree
2.2 compute the number of leaf nodes
2.3 sum all levels up, using the sum of infinite decreasing geometric series to help solving, i.e. 1/(1-q)
3. The master method
本文探讨了解决递归问题的三种方法:代换法、递归树法和大师法。代换法通过猜测解的形式并使用数学归纳法验证;递归树法则通过计算树的高度、叶节点数量及求和无穷减等比数列来解决问题;大师法则提供了一种快速解决递归问题复杂度的方法。
4247

被折叠的 条评论
为什么被折叠?



