Introduction To Algorithms, Third Edition (international Edition)
Introduction To Algorithms, Third Edition (international Edition)
3rd Edition
ISBN: 9780262533058
Author: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein
Publisher: TRILITERAL
bartleby

Concept explainers

Question
Book Icon
Chapter 4, Problem 1P

(a)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(a)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=2T(n/2)+n4 .

Explanation:

For a divide and conquer recurrence of the form T(n)=aT(n/b)+f(n) where a1,b>1 and f(n)>0, the following three cases can happen:

Case 1: If f(n)=O(n logbaε) for some constant ε>0 then T(n)=Θ(n lgba) .

Case 2: If f(n)=Θ(n lgba) then T(n)=Θ(n lgbalogn) .

Case 3: If f(n)=Ω(n logba+ε) for some constant ε>0 and if af(n/b)cf(n) for some constants c>1 and sufficiently large n then T(n)=Θ(f(n)) .

The values of a,b and f(n) are 2, 2 and n4 respectively.

Therefore, nlogba=nlog22=n and f(n)=1 . Here, f(n)=Ω(n log22+ε) where ε=3 .

So, case 3 of the master method applies.

Hence, T(n)=Θ(f(n))=Θ(n4) .

(b)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(b)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=T(7n/10)+n .

Explanation:

The values of a,b and f(n) are 1, 10/7 and n respectively.

Therefore, nlogba=nlog10/71=n0=1 and f(n)=n . Here, f(n)=Ω(n log42+ε) where ε=1/2 .

So, case 3 of the master method applies.

Hence, T(n)=Θ(f(n))=Θ(n) .

(c)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(c)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=16T(n/4)+n2 .

Explanation:

The values of a,b and f(n) are 16, 4 and n2 respectively.

Therefore, nlogba=nlog416=n2 and f(n)=Θ(n logba)=Θ(n2) .

So, case 2 of the master method applies.

Hence, T(n)=Θ(nclgn)=Θ(n2lgn) .

(d)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(d)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=7T(n/3)+n2 .

Explanation:

The values of a,b and f(n) are 7, 3 and n2 respectively.

Therefore, nlogba=nlog37 and f(n)=n2 . Here, f(n)=Ω(n log42+ε) where ε=3/2 .

So, case 3 of the master method applies.

Hence, T(n)=Θ(f(n))=Θ(n2) .

(e)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(e)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=7T(n/2)+n2 .

Explanation:

The values of a,b and f(n) are 7, 2 and n2 respectively.

Therefore, nlogba=nlog27 and f(n)=n2 . Here, f(n)=O(n log27ε) where ε>0 .

So, case 1 of the master method applies.

Hence, T(n)=Θ(n logba)=Θ(n log27) .

(f)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(f)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=2T(n/4)+n .

Explanation:

The values of a,b and f(n) are 2, 4 and n respectively.

Therefore, nlogba=nlog42=n and f(n)=Θ(n logba)=Θ(n) .

So, case 2 of the master method applies.

Hence, T(n)=θ(n lg42lgn)=θ(nlgn) .

(g)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(g)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=T(n2)+n2 .

Explanation:

The recurrence relation is not in the form of master theorem. Therefore, it cannot be solve by master theorem.

Solve the recurrence relation T(n)=T(n2)+n2

as follows:

  T(n)=T(n2)+n2=n2+(n2)2+T(n4)=n2i=0n/21+4i=0n/2i24ni=0n/2i=n2n2+413(2n3+6n2+4n)+4n12(n3+2n2)=2n33+n2+43n=Θ(n3)

Therefore, the asymptotic notation of the recurrence T(n)=T(n2)+n2 is Θ(n3) .

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
1.[30 pts] Computers generate color pictures on a video screen or liquid crystal display by mixing three different colors of light: red, green, and blue. Imagine a simple scheme, with three different lights, each of which can be turned on or off, projecting onto a glass screen: We can create eight different colors based on the absence (0) or presence (1) of light sources R,G and B: R G B Color 0 0 0 Black 0 0 1 Blue 0 1 0 Green 0 1 1 Cyan 1 0 0 Red 1 0 1 Magenta 1 1 1 0 Yellow 1 White 1 Each of these colors can be represented as a bit vector of length 3, and we can apply Boolean operations to them. a. The complement of a color is formed by turning off the lights that are on and turning on the lights that are off. What would be the complement of each of the eight colors listed above? b. Describe the effect of applying Boolean operations on the following colors: Λ 1. Red(100) ^ Magenta(101)= Blue(001) 2. Bue(001) | Green(010)= 3. Yellow(100) & Cyan(011)= 2.[30 pts] Perform the following…
D. S. Malik, Data Structures Using C++, 2nd Edition, 2010
Methods (Ch6) - Review 1. (The MyRoot method) Below is a manual implementation of the Math.sqrt() method in Java. There are two methods, method #1 which calculates the square root for positive integers, and method #2, which calculates the square root of positive doubles (also works for integers). public class SquareRoot { public static void main(String[] args) { } // implement a loop of your choice here // Method that calculates the square root of integer variables public static double myRoot(int number) { double root; root=number/2; double root old; do { root old root; root (root_old+number/root_old)/2; } while (Math.abs(root_old-root)>1.8E-6); return root; } // Method that calculates the square root of double variables public static double myRoot(double number) { double root; root number/2; double root_old; do { root old root; root (root_old+number/root_old)/2; while (Math.abs (root_old-root)>1.0E-6); return root; } } Program-it-Yourself: In the main method, create a program that…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr