Order of Execution
In a recursive function, the position in which additional statements (i.e., statements other than the recursive call itself) are placed is important. In the simple case of a function calling itself only once, a statement placed before the recursive call will be executed first in the outermost stack frame, while a statement placed after the recursive call will be executed first in the innermost stack frame. Consider this example:
Read more about this topic: Recursion (computer Science)
Famous quotes containing the words order and/or execution:
“War begets quiet, quiet idleness, idleness disorder, disorder ruin; likewise ruin order, order virtue, virtue glory, and good fortune.”
—Sir Walter Raleigh (15521618)
“If I were asked to chose between execution and life in prison I would, of course, chose the latter. Its better to live somehow than not at all.”
—Anton Pavlovich Chekhov (18601904)