How to determine the height of a recursion tree from a recurrence relation?

前端 未结 5 1088
刺人心
刺人心 2021-02-05 18:29

How does one go about determining the height of a recursion tree, built when dealing with recurrence run-times? How does it differ from determining the height of a regular tree

5条回答
  •  隐瞒了意图╮
    2021-02-05 19:28

    The depth of any tree is the smallest number of edges from the node to the tree root node.The depth of root node is 0.

    Consider the recursion T(n)=aT(n/b) It results in the following recursion tree

    enter image description here

    It is clear that depth of tree is $\log_b n$ Depth is same as height of a tree.

提交回复
热议问题