Question: Python Complexity Classes Assume that functions f1 and f2 compute the same result by processing the same argument. Empirically we find that T_f1 (N) =
Python Complexity Classes

Assume that functions f1 and f2 compute the same result by processing the same argument. Empirically we find that T_f1 (N) = 10 N log_2 N and T_f2 (N) = 100N where the times are in seconds. (a) Solve algebraically for what size N these two functions would take the same amount of time, showing how you calculated your answer. (b) for what size arguments is it better to use f1? f2? (c) Briefly describe how we can write a simple function f that runs as fast as the fastest of f1 and f2 for all size inputs. (d) What integer value N solves 78 squareroot N Log_2 N + 10,000 = 2N? Use a calculator, spreadsheet, or a program to compute (guess and refine) your answer (plotting values to see where the curves meet). Your answer should be correct for all digits up to the ones-place: e.g., a number like 23, 728. (a) (b) f1 is faster for .. f2 is faster for .. (c) Write a function f .. (d) N ~
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
