Solve the half once.
transcript
A power with a huge exponent. You halve the exponent. How you halve it matters.
Solve the half once. Twelve calls. Write the call twice. Four thousand ninety-five calls. The answers are equal. Only the calls differ.
The call on the half is written twice. So the calls double at each level. Twelve levels make four thousand ninety-five.
Level one has one call. Level two has two calls. Level three has four calls. The doubling never stops until the base case.
Call the half once. Keep the answer in a variable. Use the variable twice. That is the whole saving.
For an exponent of a billion, thirty-one calls. A loop would need a billion steps. Halving is the difference.
A second call repeats all of its work. So each repeat costs a whole subtree. That is why the calls double.
One variable saves thousands of calls. Reuse the half you already solved. Full breakdown in the lecture.