Halving the problem size at each step gives time.
Squaring a value lets you compute powers exponentially faster than repeated multiplication.
Recursive solutions create call stacks of depth , which you can eliminate with iteration if space matters.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
What you learned
Halving the problem size at each step gives time.
Squaring a value lets you compute powers exponentially faster than repeated multiplication.
Recursive solutions create call stacks of depth , which you can eliminate with iteration if space matters.