Recursion (computer Science) - Order of Execution

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:

    Where mass opinion dominates the government, there is a morbid derangement of the true functions of power. The derangement brings about the enfeeblement, verging on paralysis, of the capacity to govern. This breakdown in the constitutional order is the cause of the precipitate and catastrophic decline of Western society. It may, if it cannot be arrested and reversed, bring about the fall of the West.
    Walter Lippmann (1889–1974)

    If Germany is to become a colonising power, all I say is, “God speed her!” She becomes our ally and partner in the execution of the great purposes of Providence for the advantage of mankind.
    —W.E. (William Ewart)