• edited by
1,432 views
0 0 votes
suppose you are given n bit integers asuming for common sense n as power of 2 .it is required to multiply them using divide and conquer method .what is the divide and conquer recurrence that would arise for the problem

a) T(n)=4T(n/2)+c      

b) a) T(n)=2T(n/2)+n              

c) a) T(n)=4T(n/2)+n2          

d) a) T(n)=4T(n)+n

2 Answers

0 0 votes
According to Gauss method answer should be T(n) = T(n/2) + n

Otherwise T(n) = 4T(n/2) + n
0 0 votes

A=(an,an-1,an-2................a0)2  and B=(bn,bn-1,.....................b0)  be 2 n bit no

then A can be written as A=2^n/2Amsb+Alsb  

                                    B=2^n/2Bmsb+Blsb

 Amsb is the n/2 most significant bit of A ie n/2 leftmost bit of the no.

Alsb   is the n/2  least significant bit of A ie is n/2 rightmost bit of the no.

so A*B=(2^n/2Amsb    +      Alsb  )(   2^n/2Bmsb     +    Blsb )   =   2^n*Amsb*Bmsb  +    2^n/2(Amsb * Blsb   + Alsb *Bmsb)  +    Alsb    Blsb 

this equation says that mul of 2 n bit no can be carried out using mul of 4 n/2 digit no +some shift operatin 

so the required corresponding recurrence if T(n)= time complexity to mul 2 n bit no

T(n)  =  4*T(n/2)   +Cn

but it can also be solved in T(n)=  3*T(n/2) +cn

for more optimiation ---https://en.wikipedia.org/wiki/Karatsuba_algorithm

Position:
Show:

Related questions

0 0 votes
1 answers 1 answer
1.1k
1.1k views
1 1 vote
1 answers 1 answer
1.1k
1.1k views
Emankashyap asked Apr 30, 2024
1,053 views
In quick sort, n numbers the (n/10)th element is selected as pivot using n^2 sortimng time complexity what will be the time complexity of quick sort is.....a)O(nlogn)b)O(...
1 1 vote
1 1 answer
821
821 views
[ Jiren ] asked Aug 28, 2022
821 views
How To Solve This Using Divide And ConquerSuppose we are given the two n bit integers, assuming for common sense n as power of 2. It is required to multiply them using Di...
0 0 votes
1 answers 1 answer
1.2k
1.2k views
ajit asked Sep 7, 2015
1,170 views
given a sorted array of distinct integers A[1........n], you want to find out whether there is an index i for which A[i]=i.if this problem is solved using divide and conq...