programminga general overview throughout this bookwe will use recursion to solve problems as an example of nonmathematical useconsider large dictionary words in dictionaries are defined in terms of other words when we look up wordwe might not always understand the definitionso we might have to look up words in the definition likewisewe might not understand some of thoseso we might have to continue this search for while because the dictionary is finiteeventually either ( we will come to point where we understand all of the words in some definition (and thus understand that definition and retrace our path through the other definitionsor ( we will find that the definitions are circular and we are stuckor that some word we need to understand for definition is not in the dictionary our recursive strategy to understand words is as followsif we know the meaning of wordthen we are doneotherwisewe look the word up in the dictionary if we understand all the words in the definitionwe are doneotherwisewe figure out what the definition means by recursively looking up the words we don' know this procedure will terminate if the dictionary is well defined but can loop indefinitely if word is either not defined or circularly defined printing out numbers suppose we have positive integernthat we wish to print out our routine will have the heading printout(nassume that the only / routines available will take single-digit number and output it we will call this routine printdigitfor exampleprintdigit( will output recursion provides very clean solution to this problem to print out we need to first print out and then print out the second step is easily accomplished with the statement printdigit( % )but the first doesn' seem any simpler than the original problem indeed it is virtually the same problemso we can solve it recursively with the statement printout( / this tells us how to solve the general problembut we still need to make sure that the program doesn' loop indefinitely since we haven' defined base case yetit is clear that we still have something to do our base case will be printdigit(nif < now printout(nis defined for every positive number from to and larger numbers are defined in terms of smaller positive number thusthere is no cycle the entire function is shown in figure we have made no effort to do this efficiently we could have avoided using the mod routine (which can be very expensivebecause % / is true for positive void printoutint /print nonnegative ifn > printoutn )printdigitn )figure recursive routine to print an integer is the largest integer that is less than or equal to