Naive recursion is highly inefficient because it generates exponentially many repeated subproblems. When visualized as a recursion tree, identical nodes such as f(4), f(3), and f(2) are triggered multiple times by different parent nodes, meaning the same calculations are redundantly executed across different branches.
Conditions: The algorithm uses naive recursion without memoization.; The recurrence relation is f(n)=f(n−1)+f(n−2).
Naive recursion is highly inefficient because it generates exponentially many repeated subproblems. When visualized as a recursion tree, identical nodes such as f(4), f(3), and f(2) are triggered multiple times by different parent nodes, meaning the same calculations are redundantly executed across different branches.
Conditions: The algorithm uses naive recursion without memoization.; The recurrence relation is f(n)=f(n−1)+f(n−2).
The video constructs a recursion tree by setting the target computation f(7) as the root node. It then recursively applies the formula f(n)=f(n−1)+f(n−2) to split each non-base-case node into two child nodes.
Conditions: The recurrence relation is f(n)=f(n−1)+f(n−2).; The base cases are f(1)=1 and f(2)=1.; The target computation is f(7).
The video constructs a recursion tree by setting the target computation f(7) as the root node. It then recursively applies the formula f(n)=f(n−1)+f(n−2) to split each non-base-case node into two child nodes.
Conditions: The recurrence relation is f(n)=f(n−1)+f(n−2).; The base cases are f(1)=1 and f(2)=1.; The target computation is f(7).