Suppose that T(n) = 3 for n = 1, and for all n ≥ 2, T(n) = T(n-2) + 2n - 3. Solve this recurrence by drawing a recursion tree. Please explain your work as I am trying to learn the process of creating recursion trees.
Showing it as a Tree and each time n is down to 2 less.
By the end it will be 1. So, if we write from bottom to up, it is 1, 3, 5, 7, ... n-8, n-4, n-2, n.
If you have any doubts, comment below.
Get Answers For Free
Most questions answered within 1 hours.