Suppose the following is a divide-and-conquer algorithm for some problem.
"Make the input of size n into 3 subproblems of sizes n/2 , n/4 , n/8 , respectively with O(n) time; Recursively call on these subproblems; and then combine the results in O(n) time.
The recursive call returns when the problems become of size 1 and the time in this case is constant."
(a) Let T(n) denote the worst-case running time of this approach on the problem of size n. Please express the running time with the recurrence.
(b) Use a recursion tree to derive the asymptotic bound of T(n) with "Big Theta" (Θ) notation.
(c) Please use the substitution method to verify the asymptotic bound you derive in (b). (Note: T(n) = Θ (n) , T(n) = O(n) and T(n) = Ω(n).)
Suppose the following is a divide-and-conquer algorithm for some problem. "Make the input of size n...
Suppose that, in a divide-and-conquer algorithm, we always divide an instance of size n of a problem into 5 sub-instances of size n/3, and the dividing and combining steps take a time in Θ(n n). Write a recurrence equation for the running time T (n) , and solve the equation for T (n) 2. Suppose that, in a divide-and-conquer algorithm, we always divide an instance of size n of a problem into 5 sub-instances of size n/3, and the dividing...
Analysis Divide & Conquer: Analyze the complexity of algorithm A1 where the problem of size n is solved by dividing into 4 subprograms of size n - 4 to be recursively solved and then combining the solutions of the subprograms takes O(n2) time. Determine the recurrence and whether it is “Subtract and Conquer” or “Divide and Conquer“ type of problem. Solve the problem to the big O notation. Use the master theorem to solve, state which theorem you are using...
A divide-and-conquer algorithm solves a problem by dividing the input (of size n>1, T(1) =0) into two inputs half as big using n/2-1 steps. The algorithm does n steps to combine the solutions to get a solution for the original input. Write a recurrence equation for the algorithm and solve it.
A divide-and-conquer algorithm solves a problem by dividing the input (of size n>1, T(1) =0) into two inputs half as big using n/2-1 steps. The algorithm does n steps to combine the solutions to get a solution for the original input. Write a recurrence equation for the algorithm and solve it.
For [Select], there are three choices: worse than, the same as, better than Answer the following questions about the computational properties of divide-and-conquer sorting algorithms, based on tight big-Oh characterizations of the asymptotic growth rate of the functions for the running time or space size, depending on the question. Assume that the input sequence is given as a list, and the output sequence is also a list. Also assume a general implementation of the sorting algorithms, as opposed to an...
Provide a divide-and-conquer algorithm for determining the smallest and second smallest values in a given unordered set of numbers. Provide a recurrence equation expressing the time complexity of the algorithm, and derive its exact solution (i.e., not the asymptotic solution). For simplicity, you may assume the size of the problem to be an exact power of a the number 2
(20 points) Recall the following deterministic select algorithm: (a) Divide the n elements into groups of size 5. So n/5 groups. (b) Find the median of each group. (c) Find the median x of the n/5 medians by a recursive call to Select. (d) Call Partition with x as the pivot. (e) Make a recursive call to Select either on the smaller elements or larger elements (de- pending on the situation); if the pivot is the answer we are done....
Weird recursion tree analysis. Suppose we have an algorithm that on problems of size n, recursively solves two problems of size n/2, with a “local running time” bounded by t(n) for some function t(n). That is, the algorithm’s total running time T(n) satisfies the recurrence relation T(n) ≤ 2T(n/2) + t(n). For simplicity, assume that n is a power of 2. Prove the following using a recursion tree analysis (a) If t(n) = O(n log n), then T(n) = O(n(log...
Consider recursive divide-and-conquer algorithms with the following descriptions. For each, determine the running time in Big-Theta notation. If necessary, you may assume that the regularity condition holds. You do not need to prove your result. You may use the Master Theorem (n3) work per Performs 8 recursive calls on problems half the size of the input and performs recursive call. Consider recursive divide-and-conquer algorithms with the following descriptions. For each, determine the running time in Big-Theta notation. If necessary, you...
4.5-2 Professor Caesar wishes to develop a matrix-multiplication algorithm that is asymptotically faster than Strassen’s algorithm. His algorithm will use the divide- and-conquer method, dividing each matrix into pieces of size n/4 x n/4, and the divide and combine steps together will take O(n) time. He needs to determine how many subproblems his algorithm has to create in order to beat Strassen’s algo- rithm. If his algorithm creates a subproblems, then the recurrence for the running time T(n) becomes T(n)...