October 2019
Beginner to intermediate
498 pages
14h 13m
English
Before we look at the program used to draw the tree, we must first learn a little more about recursion. In computer science and mathematics, a recursive function is a function that calls itself. A very simple, but erroneous, illustration of a recursive function is shown in LISTING 9.1.
LISTING 9.1 An erroneous recursive function
The hello function prints the message "Hello World" and then calls itself again. If you ran this function in Python, the program would continue to call itself and print "Hello World" until Python simply crashed. Clearly, there’s more to a successful recursive function than simply calling ...
Read now
Unlock full access