How does the computer keep track of all the calls to a recursive function?

What will be an ideal response?


A computer keeps track of recursive calls as follows: When a function is called, the computer plugs in the argument(s) for the parameter(s) and begins to execute the code. If a recursive call should be encountered then suspends the current function, saving all the information necessary to continue this incarnation of the function after the recursive call is done. When the recursive call is completed, the suspended invocation continues. The only limit on the number (or depth) of recursion is machine resources, primarily memory. The process will not terminate unless and until one of the calls to the function does not depend on recursion to return a value.

Computer Science & Information Technology

You might also like to view...

Find all well-separated clusters in the set of points shown in Figure 8.1. The solutions are also indicated in Figure 8.1.

What will be an ideal response?

Computer Science & Information Technology

________ are compression algorithms that reduce the size of digital media files

Fill in the blank(s) with correct word

Computer Science & Information Technology

Swing components are UI elements such as dialog boxes and buttons. You can usually recognize their names because they begin with ____.

A. the letter S B. Swing C. the letter J D. UI

Computer Science & Information Technology

An early type of animation that was used in the earliest Walt Disney movies is _______________ .

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology