Question: Consider algorithm Algorithm 1: printHello input : n: a number output : N.A. side effect: Print hello n times plan : i for i =


Consider algorithm Algorithm 1: printHello input : n: a number output : N.A. side effect: Print hello n times plan : i for i = 1 to n do 2 print "hello"; 3 end (a) What is the input size of the algorithm? Explain. (b) What is the best case of the algorithm? What is the asymptotic Upper Bound of the running time of the algorithm in this case? (c) What is the worst case of the algorithm? What is the asymptotic Upper Bound of the running time of the algorithm in this case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
