Problem

Section 2.2 describes a method for solving recurrence relations which is based on analyzin...

Section 2.2 describes a method for solving recurrence relations which is based on analyzing the recursion tree and deriving a formula for the work done at each level. Another (closely related) method is to expand out the recurrence a few times, until a pattern emerges. For instance, let’s start with the familiar T(n) = 2T(n/2) + O(n). Think of O(n) as being ≤ cn for some constant c, so: T (n) ≤ 2T (n/2) + cn. By repeatedly applying this rule, we can bound T (n) in terms of T(n/2), then T(n/4), then T(n/8), and so on, at each step getting closer to the value of T(∙) we do know, namely T(1) = O(1).

A pattern is emerging... the general term is

Plugging in k = log2 n, we get T(n)< n T(1) + cnlog2 n = O (n log n).

(a) Do the same thing for the recurrence T (n) = 3T (n/2) + O (n). What is the general kth term in this case? And what value of k should be plugged in to get the answer?


(b) Now try the recurrence T(n) = T(n − 1) + O(1), a case which is not covered by the master theorem. Can you solve this too?

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 2
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT