Question: Find the expression of the program below for T(n), the number of times hello is printed, as a function of n, showing the details whenever
Find the expression of the program below for T(n), the number of times hello is printed, as a function of n, showing the details whenever possible. You can assume n is a power of 2 & give T(n) in its simplest notation.
for i = 1 to n { for j = 1 to n print hello k = 1 while (k < n) { print hello k = k * 2 } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
