Prove the correctness of following recursive algorithm for computing \(a^n\) using induction. Power(a, n) { if(n == 0) return 1; else return a *…
BIT Discrete Structure · 2082 · Solved Question with Answer
Prove the correctness of following recursive algorithm for computing \(a^n\) using induction.
Power(a, n)
{
if(n == 0) return 1;
else return a * Power(a, n-1);
}