Question: Question 34 Consider the following algorithm: k=1; for i=0 to n1 (inclusive) stepping up by 1 k=2k for j=1 to k stepping by 1 print

Question 34 Consider the following algorithm: k=1; for i=0 to n1 (inclusive) stepping up by 1 k=2k for j=1 to k stepping by 1 print " hello" Suppose that n=3 coming into this algorithm: a. how many "hello"s will be printed? b. In formula form, how is this number of "hello"s related to 3 c. In general, what is the formula relating n to the final value of k and hence what is the Big-O of the loop printing "hello"s in terms of n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
