Which of the following is required in a recursive function?

a) Exactly one recursive call and exactly one stopping case.
b) Calls to functions other than itself.
c) One or more stopping cases after a sequence of calls to one or more recursive cases.
d) A static local variable.
e) One or more stopping cases that are guaranteed to be reached.

c) One or more stopping cases after a sequence of calls to one or more recursive cases. , and e) One or more stopping cases that are guaranteed to be reached.

All of these are possible in a recursive function. However, part a) is too restrictive. Part b) is not required for a recursive function. However, the nonrecursive case may call another function. A collection of mutually recursive functions is certainly a possibility. A first function may have a (potentially recursive) call to another functions that in turn may (recursively) call the first function. Part d): Any function, including a recursive function, may have a static local variable.

Computer Science & Information Technology

You might also like to view...

If you want to connect your home network to the Internet, you will need a ________ in addition to a modem

A) repeater B) router C) terminator D) switch

Computer Science & Information Technology

The statement in a for each in array statement will only be performed if a condition is met.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology