Use the following algorithm to devise an algorithm for computing $a^n$,
Hint: use binary expansion of $n$ to evaluate $a^n$.
The following algorithm is based on the above algorithm to evaluate $a^n$, but I don't see that it does anything extra and I don't see it using the hint too,
Question: We can use both algorithms above to evaluate $a^n$. I don't see how algorithm presented above based on the first algorithm above does answer the question?