Question: Please type your answer. Question 9: Running Time A For the C++ function below, give the tightest asymptotic upper bound that you can determine for
Please type your answer. 

Question 9: Running Time A For the C++ function below, give the tightest asymptotic upper bound that you can determine for the function's runtime, in terms of the input parameter, n. Also compute the return value of the function. Assume that the input parameter n > 2. int fun(int n) { int r; int s = @; for (int q = 1; 9 2; r--) S-- return r S; } 1. Worst case asymptotic running time is: of symbolic expression 2. An exact expression for the return value is: fun(n) = symbolic expression Symbolic General format information: Your answer must be a symbolic expression. All numbers must be rational - so, 1/2 instead of 0.5. Complex numbers are not allowed. Allowable variables, constants, and operators: n pi e cos sin tan arccos arcsin arctan acos asin atan arctan2 atan2 explog sort O + 7 A ** All operations must be explicit: Example valid inputs: 2*3 cos (1) Example invalid inputs: 2(3) COS 1 Note that either or can be used for exponentiation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
