Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Algorithm prod2(x, y) for large integer multiplication to find the product 2506 and 69309. How many multiplication are needed to find the product of

image text in transcribed

Use Algorithm prod2(x, y) for large integer multiplication to find the product 2506 and 69309. How many multiplication are needed to find the product of the two integers if prob2(x, y) is used.

Algorithm prod2(a, b) //Multiply two large integers a and b Input: Output: prod, the product of a and t n- maximum(number of digits of a, number of digits of b); if(a 0 or b 0) then return 0 else if(n threshold) return a * b in the usual way large integers a and b; else 2 x_ a divide 10m- y= a rem I w b divide 10m, z = b rem 10m. r- prod2(x + y, w + z); m. q prod2(y, z); return p *102m+ (r-p-q) * 10m+ 9

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

define EFFECTIVE PARTICIPATION

Answered: 1 week ago