Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. You have an idea for a faster program. You scour the Internet and, as luck would have it, you find an algorithm one prime.factor

image text in transcribed
4. You have an idea for a faster program. You scour the Internet and, as luck would have it, you find an algorithm one prime.factor (N) that, given an 1-digit binary number, N, will find one prime factor of the number in O(na) time. (a) Using this algorithm (as a black box), give an efficient algorithm to factor an 1-digit binary number into primes and print the prime factors). (b) Approximately how many times does your factoring algorithm use the one-prime factor (N) routine in the worst case, as a function of n? (c) How fast is your algorithm in the worst case), in order notation, as a function of n? As above, assume that it takes linear time, i.e. e(n) time, to add, subtract, multiply, and divide two n-digit binary numbers. (d) Is your new program fast enough? Justify. 4. You have an idea for a faster program. You scour the Internet and, as luck would have it, you find an algorithm one prime.factor (N) that, given an 1-digit binary number, N, will find one prime factor of the number in O(na) time. (a) Using this algorithm (as a black box), give an efficient algorithm to factor an 1-digit binary number into primes and print the prime factors). (b) Approximately how many times does your factoring algorithm use the one-prime factor (N) routine in the worst case, as a function of n? (c) How fast is your algorithm in the worst case), in order notation, as a function of n? As above, assume that it takes linear time, i.e. e(n) time, to add, subtract, multiply, and divide two n-digit binary numbers. (d) Is your new program fast enough? Justify

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

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago