a.
To multiply two linear polynomials
a.
Explanation of Solution
Multiply two linear polynomials
Thus, the product of two polynomials is as follows:
b.
To provide two divide-and-conquer
b.
Explanation of Solution
Method 1(for dividing the input polynomial coefficients into a high half and low half):
Take two polynomials be
Now, assume that two polynomials are to be multiplied. Then,High half will be
Since, it is known that
Now on using master’s theorem the recurrence for above is calculatedto be as follows:
Method2(for dividingthe input polynomial coefficients based onif the index is even or odd the procedure):
Assume the odd index beOiand even index be Eisuch that
Then,
Therefore,
Now on using master’s theorem the recurrence for above is calculatedto be as follows:
c.
To show methodto multiply two n-bit integers in
c.
Explanation of Solution
To multiply two n-bit integers in
The generalization of the polynomial can be given as
The two n-bit integers can be taken as
These two algorithms are developed to solve the multiplication problem of polynomialwith run time of
Want to see more full solutions like this?
- Design a divide-and-conquer algorithm to solve the maximum sum subarray problem. Give the recurrence equations for the running time of your algorithm and solve it. Your algorithm should have a complexity of Θ(n log n).arrow_forwardLet's say there are n villages, {X1, . . . , Xn} on the country-road and we aim to build K < n restaurants to cover them. Each restaurant has to be built in a village, and we hope to minimize the average distance from each village to the closest restaurant. Please give an algorithm to compute the optimal way to place these K restaurants. The algorithm should run in O(k * n^2) time. Solutions with slightly higher time complexity also accepted.arrow_forwardUse the divide and conquer strategy to understand the binary search for a sorted list of n elements. Let T(n) denote the time complexity function for the binary search. Derive a recurrence relation for T(n) and solve for T(n) to get a close form expression.arrow_forward
- In one pass and space O(n log n), the above algorithm constructs a (1/6)-approximate weighted matching M.give proofarrow_forwardAssume that we have a way of multiplying 2 by 2 matrices using 7 multiplications. Use this, to design a divide and conquer algorithm for multiplying n by n matrices in O(n^log7) time.You should briefly outline the algorithm, write a recurrence relation, and solve it to derive the time complexity.arrow_forwardImplement the divide-and-conquer O(n) time algorithmarrow_forward
- Given a set of n numbers, we wish to find the i largest in sorted order using a comparison-based algorithm. Find the algorithm that implements each of the following methods with the best asymptotic worst-case running time, and analyze the running times of the algorithms in terms of n and i. a. Sort the numbers, and list the i largest. Group of answer choices 1. O(ni) 2. O(nlg(n)) 3. O(n + ilg(n)) 4. O(i + nlg(n)) 5. O(n + ilg(i)) b. Build a max-priority queue from the numbers, and call EXTRACT-MAX i times. Group of answer choices 1. O(i + nlg(n)) 2. O(n + ilg(n)) 3. O(nlg(n)) 4. O(ni) 5. O(n + ilg(i)) c. Use an order-statistic algorithm to find the ith largest number, partition around that number, and sort the i largest numbers. Group of answer choices 1. O(n + ilg(i)) 2. O(n + ilg(n)) 3. O(nlg(n)) 4. O(i + nlg(n)) 5. O(ni)arrow_forwardGiven a string S[1, . . . , n] and a dictionary of strings S, return true if S[1, . . . , n] can be segmented into a space-separated sequence of one or more dictionary words. Note that the same word in the dictionary may be reused multiple times in the segmentation. Precisely define the subproblem.Provide the recurrence equation.Describe the algorithm in pseudocode to compute the optimal value.Describe the algorithm in pseudocode to print out an optimal solution.arrow_forwardConstruct a Divide and Conquer-based algorithm for the following problem andanalyze the same in the worst case.Input: An ordered array L with n elements and item X that is to be searched inthe array L.Output: Index j where L[j]=X, if X is found or else j = 0, if X not found.arrow_forward
- Suppose that, in a divide-and-conquer algorithm, we always divide aninstance of size n of a problem into 10 subinstances of size n/3, and thedividing and combining steps take a time in Θ(n2) in n>1, and it performs one basic operation if n = 1. Write a recurrenceequation for the running time of T(n), and solve the equation.arrow_forwardQuestion 3 The Extended Euclidean Algorithm allows us to efficiently compute inverses in Z∗n (and also in Galois fields). If gcd(n,a)=1, and EEA gives 1=sn+ta, then a−1≡tmodn. Use this method to compute the following inverses. Please give the answer in the natural range from 0 to n−1 where n is the modulus. Modulo 674, 103−1≡ Modulo 982, 483−1≡ Modulo 220, 149−1≡ Modulo 571, 443−1≡ Full explain this question and text typing work only thanksarrow_forwardConsider the Divide and Conquer algorithm for multiplying large integers.(a) What is the least number of digits that the product of two 3-digit numbers can have?(b) Use the algorithm to compute 96 * 43.(c) Write the recurrence relation for the number of multiplications made by the algorithm.(d) Using the Master’s Theorem or otherwise, determine the order of growth of this algorithm.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning