Design and analyze a divide-and-conquer algorithm

Assignment Help Data Structure & Algorithms
Reference no: EM132264456

Question 1.

Recall the following "Baby" Master Theorem that we proved in class:

"Baby" Master Theorem: Let a > 0, b > 1 and d > 0 be constants. Then the solutions of a recurrence of the form

T(n) = aT (n/b) + Θ(nd),

where T(n) is a constant for all small enough n, is

43_equation.jpg

Apply this theorem to solve the recurrences in (a) - (f) below, where T(n) is constant for n ≤ 2. For each recurrence, justify how you apply the theorem (what are the values of a, b, d and which case applies), and express the solution in the 00 notation. (Note: 4 points for each of (a)-(f).)

(a) T(n) = 4T (n/2) + n2.
(b) T (n) = 2T(7n/10) + n3.
(c) T(n) = 7T(n/3)+n.
(d) T(n) = 6T (n/4) + n√n.
(e) T (n) = 5T(n/9) + √n.
(f) T(n) = 3T(n/27) + 3√n.

Question 2.

Textbook Exercise 4.5-2 (page 97). You need to justify your answer.

Question 3.

Suppose that T(n) is a constant for n ≤ 2. Solve the following recurrences for T(n) and express the solutions in the Θ() notation.
(a) T (n) = T (n - 2) + n3.
(b) T (n) = 3T (n/3) + nlog2n.

Question 4.

Consider the recurrence T (n) given by

T (n) = 2T (n/2) + lg n,

where T (n) = 0 when n = 1.

(a) Solve T(n) using substitution with enhanced induction hypothesis as discussed in the Text¬book page 85.

(b) Solve T(n) by changing variables as discussed in the Textbook page 86 (starting with setting lg n = m) and repeated unfolding as discussed in the class. You should derive the exact expres¬sion for T (n).

Question 5.

Consider the deterministic quick selection algorithm (the algorithm SELECT in the Textbook, to find the k-th smallest item from a set of n unsorted items in 0 (n) worst-case time for any given integer k ∈ [1, n]) . Suppose we modify the algorithm so that the items are divided into groups of 9 (rather than groups of 5). Does the algorithm still run in worst-case linear time? Give a new recurrence for the worst-case running time T (n) , and solve T (n) and express it in terms of an asymptotic bound, i.e., either show that T (n) = O(n) , or show that T (n) = ω(n) .

Question 6.
Let x1, x2, .... , xn, be an unsorted sequence of real numbers (each of which can be positive, neg-ative, or 0), where n > 1. Design and analyze a divide-and-conquer algorithm to find the sub-sequence of consecutive elements such that the product of the numbers in it is maximum over all consecutive subsequences. Here the "subsequence" must have length at least 1; i.e., it must be non-empty. Your algorithm should run in 0 (n log n) time.

Reference no: EM132264456

Questions Cloud

Design and implement a CashRegister class : Design and implement a CashRegister class that scans the product prices, counts the number of items and shows the total purchase
What should the organization assess : What should the organization assess in addition - You should insist on the presence of the team members to the appointed date
Explain how to improve software construction process : Explain how to improve software construction process by: minimizing complexity, taking care of anticipated changes, verification of code
Estimating the average amount of money : A marketing student is estimating the average amount of money that students at a large university spent on sporting events last year
Design and analyze a divide-and-conquer algorithm : Design and analyze a divide-and-conquer algorithm to find the sub-sequence of consecutive elements such that the product of the numbers
Write some benefits and features of EMC ViPR SDS solution : Write some benefits and features of EMC ViPR SDS solution. Compare ViPR with any such equivalent service available
What is your analysis to increase the traffic on the site : Question: What is your analysis that utilising our own platform for our website would increase the traffic on the site Yes/No and WHY
Share in the management responsibilities : Which of the following is true regarding Kitty's statement that she had no personal liability?
Describe the six types of e-commerce : Identify and describe the six types of e-commerce. Give an example for each one.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd