Time complexity analysis: solving recurrences

来源:互联网 发布:中国言论自由知乎 编辑:程序博客网 时间:2024/06/11 05:54
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