Using Tree Recursion

Use the fact that if e is even, then

be = (be/2)2



As we will see in a later chapter, the height of this tree is Θ(log e).

A "divide and conquer" implementation of mod-expt is shown at right.