Question: 29. Consider the following algorithm: for (i = 1; i < i = 1; i--) cout < < i; (a) What is the output
29. Consider the following algorithm: for (i = 1; i < i = 1; i--) cout < < i; (a) What is the output when n = 2, n = 4, and n = 6? (b) What is the time complexity T(n)? You may assume that the input n is divisible by 2.
Step by Step Solution
3.41 Rating (148 Votes )
There are 3 Steps involved in it
Solution fori1 i 1 i cout i For n2 first for loop 123 ... View full answer
Get step-by-step solutions from verified subject matter experts
