Multiple choice

Which of the following is NOT a valid statement regarding recursive functions?

  1. A recursive function is a special function that calls itself.

  2. A recursive function allows us to break down a complex problem in small parts.

  3. It must have an exit condition.

  4. The first function call should be the first one to complete.

  5. Recursion method is applied in many algorithms such as quick sort or binary sort.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

One of the properties of recursive functions is that a given function call must wait for the following function calls to complete its run before it itself can finish. The innermost function call must be completed before we can finish the next inner function call. We must make sure that the first function call (the outermost one) will be the last one to complete.