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 of, order and/or execution:
“Out of the slimy mud of words, out of the sleet and hail of verbal imprecisions,
Approximate thoughts and feelings, words that have taken the place of thoughts and feelings,
There springs the perfect order of speech, and the beauty of incantation.”
—T.S. (Thomas Stearns)
“I thought that the chief thing to be done in order to equal boys was to be learned and courageous. So I decided to study Greek and learn to manage a horse.”
—Elizabeth Cady Stanton (18151902)
“Some hours seem not to be occasion for any deed, but for resolves to draw breath in. We do not directly go about the execution of the purpose that thrills us, but shut our doors behind us and ramble with prepared mind, as if the half were already done. Our resolution is taking root or hold on the earth then, as seeds first send a shoot downward which is fed by their own albumen, ere they send one upward to the light.”
—Henry David Thoreau (18171862)