Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In class we saw that Karatsuba multiplication allowed one to multiply two n-bit numbers in O(nlog(3)) time. It turns out that using the Fast

 

In class we saw that Karatsuba multiplication allowed one to multiply two n-bit numbers in O(nlog(3)) time. It turns out that using the Fast Fourier Transform, one can multiply numbers in nearly linear time. For the purposes of this problem, assume that one has an algorithm Mult(N, M) that can multiply two n-bit numbers in O(n) time. (a) Give an algorithm to multiply k n-bit numbers N1, N2,..., Nk in O(k log(k)n) time. [20 points] (b) Give an algorithm to compute the kth power of an n-bit number in O(kn) time. [10 points] [Note: When you multiply two numbers together the length of the resulting number will be the sum of the lengths of the original numbers. This means that you cannot, for example, solve part (a) by simply multiplying the numbers one at a time, since the 4th product will involve ln-bit numbers and thus take O(ln) time, making the total runtime O(kn).]

Step by Step Solution

3.39 Rating (152 Votes )

There are 3 Steps involved in it

Step: 1

a Algorithm to multiply k nbit numbers N1 N2 Nk in Oklogkn time 1 Split the k numbers into two group... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Algorithms

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

3rd edition

978-0262033848

Students also viewed these Programming questions