Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We compare two different divide and conquer algorithms for the same problem. Algorithm A: On an array of size n , the algorithm produces FOUR

We compare two different divide and conquer algorithms for the same problem.
Algorithm A: On an array of size n, the algorithm produces FOUR sub arrays, each of size n2 performing \Theta (n2) work in the process. The time taken to combine the output of the sub problems is \Theta (n).
Algorithm B: On an array of size n, the algorithm produces THREE sub arrays, each of size n2 performing \Theta (n2) work in the process. The time taken to combine the output of the sub problems is \Theta (n)
.
1) Write down the recurrences for the running time A(n) for algorithm A and B(n) for algorithm B on inputs of size n. You do not need to write out the base case.
2) Solve for A(n) using the master method to derive a Theta bound on worst case running time of algorithm A.
3) Solve for B(n) using the master method to derive a Theta bound on worst case running time of algorithm B.
---
Master Method
The recurrence T(n)=aT(nb)+\Theta (nc)
with base case
T(1)=\Theta (1)
has the solution
Case 1 logba>c
then T(n)=\Theta (nlogb(a))
Case 2 logba=c
then T(n)=\Theta (nlogb(a)log(n))
Case 3 logba

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

Students also viewed these Databases questions