1. Engineering
  2. Computer Science
  3. recursive algorithm the function receives two inputs a and n...

Question: recursive algorithm the function receives two inputs a and n...

Question details

Recursive Algorithm The function receives two inputs: a and n. a is a real number and n is an integer such that n 2 0. It should return Super Power(am) = aan+1 Note that in the expression above, the exponent of a is 3n +1. Below is a recursive algorithm to compute SuperPower(a, n) with some lines missing. SuperPowera, n ) If A Return B) ySuperPower C,D I/ Recursive Call Return( E) // Base case // Mathematic expression using y and/or a End (2 points each question:) 6. For the recursive algorithm, what expression should go in the space labeled A? (a) a= 1 (b) a=0 (c) n-1 (d) n-0 7. For the recursive algorithm, what expression should go in the space labeled B? (c) 1 (d) 0 (a) a (b) a3 8. For the recursive algorithm, what expression should go in the space labeled C? (a) a DIV 2 (b) a (c) n -1 (d) a -1 9. For the recursive algorithm, what expression should go in the space labeled D? (c) a-1 (d) n DIV 2 (a) n 10. For the recursive algorithm, what expression should go in the space labeled E? (a) a3 (b) y a3 (c) уз (d) уз, а

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution