Question: 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.

 Recursive Algorithm The function receives two inputs: a and n. a

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)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!