Question: 1 . ( 1 0 points ) Let y and z be n - bit integers, where n is a power of 3 . Consider
points Let y and z be nbit integers, where n is a power of Consider the following
divideandconquer algorithm to compute the product yz
Divide y into three n
bit pieces, a b and c; thus y an bn c where the powers of
denote appropriate bitshifting. Similarly, divide z into pieces d e and f Now compute yz
recursively as:
yz adnae bdn af be cdnbf cen cf
You may ignore the issue of carries throughout this problem.
a Write down the recurrence, T n for the worstcase running time of this algorithm. Analyze
T n using the Little Master Theorem and determine the running time.
With a view towards improving the running time in part a consider the following approach,
where we first compute certain intermediate products r r recursively and use these along
with additions and bitshifts to compute yz
r ra bd e r be r r cf r and yz
b Fill in the missing information above for r r and r and show how to compute yz Try to
use as few multiplications as you can to compute r r and r
c Write down the recurrence, T n for the worstcase running time of this algorithm. Analyze
T n using the Little Master Theorem and determine the running time. How does it compare with
the running time of the algorithm we designed in class, where we divided the input integers into
halves?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
