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: Recursive Call
Famous quotes containing the words order of, order and/or execution:
“Undoubtedly we have not questions to ask which are unanswerable. We must trust the perfection of the creation so far, as to believe that whatever curiosity the order of things has awakened in our minds, the order of things can satisfy. Every mans condition is a solution in hieroglyphic to those inquiries he would put. He acts it as life, before he apprehends it as truth.”
—Ralph Waldo Emerson (18031882)
“He had discovered a great law of human action, without knowing itnamely, that in order to make a man or a boy covet a thing, it is only necessary to make the thing difficult to attain. If he had been a great and wise philosopher, like the writer of this book, he would now have comprehended that Work consists of whatever a body is obliged to do and that Play consists of whatever a body is not obliged to do.”
—Mark Twain [Samuel Langhorne Clemens] (18351910)
“Those who govern, having much business on their hands, do not generally like to take the trouble of considering and carrying into execution new projects. The best public measures are therefore seldom adopted from previous wisdom, but forced by the occasion.”
—Benjamin Franklin (17061790)