recursion move( , , , level number of calls move( - move( - move( - move( - move( - move( - move( move( - move( move( ** - figure the recursive call tree for the towers of hanoi puzzle with disks exponential operation some of the recursive examples we have seen are actually slower than an equivalent iterative version such as computing fibonacci number those were introduced to provide simple examples of recursion other problems such as solving the towers of hanoi puzzle can only be done using recursive algorithm there are some problemshoweverin which the recursive version is more efficient than the iterative version one such example is the exponential operationwhich raises number to power by definitionthe exponential operation xn can be expressed as multiplied by itself times ( xfor exampley would be computed as of coursein python this can be done using the exponential operatory * but how is this operation actually performed in pythona basic implementation would use an iterative loopdef exp xn ) for in rangen ) * return this implementation requires linear timewhich is relatively slow if we are raising value to large power for examplesuppose we want to compute the basic implementation requires , iterations to compute this valuebut each iteration performs multiplicationwhich itself is time consuming when compared to other operations fortunatelythere is faster way to raise value to an integer