1) Give a solution to T(n) = T(n-1) + 2n where T(1) = 5. (25p) 2) Use the master theorem to solve the following recurrence (25p) a) T(n) = 6T(n/3) + n^2 b) T(n) = 16T(n/4) + 5n^3 3) Give a solution to T(n) = T(n/3) + 2 where T(2) = 2. (25p) The lesson is the design and analysis of algorithms from computer science. Please give the solution for each question step by step.
Added by Douglas E.
Your feedback will help us improve your experience
Adi S and 82 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
Problem 3: Use the method of iterative substitution to solve the following recurrence. Give the asymptotic solution as well. Assume that T(n) is constant for n <= 5. T(n) = { c if n <= 5 T(n - 2) + log(n) if n > 5
Adi S.
Find the solution to each of these recurrence relations and initial conditions. Use an iterative approach such as that used in Example $10 .$ a) $a_{n}=3 a_{n-1}, a_{0}=2$ b) $a_{n}=a_{n-1}+2, a_{0}=3$ c) $a_{n}=a_{n-1}+n, a_{0}=1$ d) $a_{n}=a_{n-1}+2 n+3, a_{0}=4$ e) $a_{n}=2 a_{n-1}-1, a_{0}=1$ f) $a_{n}=3 a_{n-1}+1, a_{0}=1$ g) $a_{n}=n a_{n-1}, a_{0}=5$ h) $a_{n}=2 n a_{n-1}, a_{0}=1$
Basic Structures: Sets, Functions, Sequences, Sums,and Matrices
Sequences and Summations
Solve exactly (by iterative substitution) T(n) = { 4 n = 1; 4T(n - 1) + 3 n > 1
Shu-Ting H.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD