Question: Problem 9 (16 points). Consider the algorithm for multiplying two n-digit integers. For simplicity, we assume n is an integer power of 2. Assuming the

Problem 9 (16 points). Consider the algorithm for multiplying two n-digit integers. For simplicity, we assume n is an integer power of 2. Assuming the first integer is stored in the A array and the second integer is stored in the B array. The array A has size n, the entries are indexed by 0,1,2,,n1 and each entry in A is an integer between 0 and 9 . The integer denoted by the array is i=0n1A[i]10i, For example if n=16 and the first integer is 8265316910735160 , then A=[0,6,1,5,3,7,0,1,9,6,1,3,5,6,2,8] and A[0]=0,A[1]=6,A[2]=1 etc. We can define B similarly for the second integer. We need to print the product of the two integers. Algorithm (9)-sub and (9)-main give the pseudo code for the algorithm where the entry algorithm is (9)-main. In the algorithms, all arrays are 0 -indexed. Fill in box (9a) and (9b) with the right pseudo-codes, and answer the following questions: (9c) Briefly explain what line 2-4 in Algorithm (9)-main are doing (the lines in red color). (9d) What is the running time of the algorithm? 5 6. CM 7: C array of (2n1)0 's 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
