Chapter

Recursion

From ComputerScienceOne by Dr Chris Bourke

Concepts

  1. How can a countdown be written without a loop?

    "Suppose we wanted to write a simple program that performed a countdown, printing 10, 9, 8, . . . , 2, 1 and when it reached zero it printed a “Happy New Year” message. Likely our first instinct would

  2. What happens when a function calls itself?

    "The function in this case is called CountDown (). In Line 5 the function calls itself on a decremented value. When a function calls itself, it is a recursive function. When a language allows function

Recursion | ComputerScienceOne | Bifalgorithm | Bifalgorithm