Question: 1. [10 points] Consider the algorithm shown above. a) (2 pts) What does the algorithm do? Justify your answer. Design and Analysis of Algorithms Prof.
1. [10 points] Consider the algorithm shown above. a) (2 pts) What does the algorithm do? Justify your answer. Design and Analysis of Algorithms Prof. Tassos Dimitriou Homework 1 Deadline: February 20, 2023 by 23:55pm b) (3 pts) Analyze the algorithm and determine its running time as a function of n. Use the Big-O() notation and consider the behavior of the algorithm on the worst possible input. c) (5 pts) Come up with a better algorithm for the same problem. For example if your algorithm in the first part was (say) (n3) then you should produce an algorithm that is strictly less than (n3), like (n) or (n2), etc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
