Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using python (a) Write a function alt_gcd (a,b) that returns the gcd of a, b (where a, b are positive integers), but do NOT use
using python
(a) Write a function alt_gcd (a,b) that returns the gcd of a, b (where a, b are positive integers), but do NOT use the Euclidean algorithm. Rather, use the factoring function you wrote for last homework (or some modification of it); recall that itf we know the prime factorizations of both a, b, we can find the gcd by looking at the smaller power of each prime that occurs in each of a, b. (b) Let f(n) be the maximum of the running time of your alt_gcd (a,b) function, where a, b range over all pairs of n digit numbers. Using timed experiments, guess the rough order of growth off(n) as n oo (ie, is it logarithmitic, linear, quadratic, exponential)? The % time and time commands may be useful for doing the timingStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started