Use recursion trees to solve each of the following recurrences. A(n) = 2A(n/4) + sqrt{n} B(n) = 2B(n/4) + n C(n) = 2C(n/4) + n^2 D(n) = 3D(n/3) + sqrt{n}
Added by Natalie R.
Close
Step 1
A(n) = 2A(n/4) + vn The recursion tree for this recurrence would have each node representing a cost of vn and two children with problems of size n/4. The total cost at each level i of the tree is 2^i * v(n/4^i) = vn/2^i. The height of the tree is log4(n) = Show more…
Show all steps
Your feedback will help us improve your experience
Shreya Jain and 67 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Akash M.
Solve the recurrence T(n) = 2T(n * 2/3) + n^2 first by using a recursion tree and then using the Master theorem. Show work.
Find the solution to each of these recurrence relations with the given initial conditions. Use an iterative approach such as that used in Example 10. a) $a_{n}=-a_{n-1}, a_{0}=5$ b) $a_{n}=a_{n-1}+3, a_{0}=1$ c) $a_{n}=a_{n-1}-n, a_{0}=4$ d) $a_{n}=2 a_{n-1}-3, a_{0}=-1$ e) $a_{n}=(n+1) a_{n-1}, a_{0}=2$ f) $a_{n}=2 n a_{n-1}, a_{0}=3$ g) $a_{n}=-a_{n-1}+n-1, a_{0}=7$
Basic Structures: Sets, Functions, Sequences, Sums,and Matrices
Sequences and Summations
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD