Question: 6. (16 points) For each C++ function below, give the tightest asymptotic upper bound that you can determine for the function's runtime, in terms of




6. (16 points) For each C++ function below, give the tightest asymptotic upper bound that you can determine for the function's runtime, in terms of the input parameter Where prompted, also compute the return value of the function. For all function calls, assume that the input parameter n 2 2. int raspberryscone (int n) f int s=0; for (int q -0; q 2; r--) return r*S; Return value for (a): Running time of (a): int peanutbuttercheesecake (int n) f int i-0; int j- 4*n; for (int k-j* j; k > 1; k - k/ 2) 1 return i * ilA Return value for (b): Running time of (b): int almondcaramelbrittle(int n) f int c-0; int s; for (s -1; s 1; m - m 2) cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
