Question: Data Structure 1. Suppose that algorithm A takes 1000n 3 steps and algorithm B takes 2An steps (Note the carot symbol means raise to the
Data Structure

1. Suppose that algorithm A takes 1000n 3 steps and algorithm B takes 2An steps (Note the carot symbol means raise to the power of which we use here becuase we cannot create the appropriate mathematical symbol in moodle) for a problem of size n. For what size of problem is algorithm A faster than B (meaning algorithm A has fewer steps than B)? In your answer describe not only what the answer is but how you arrived at the answer. 2. Give the upper bound (big O notation) that you can for the following code fragment, as a function of the initial value of n. for(int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
