bibian7074 bibian7074
  • 24-01-2020
  • Computers and Technology
contestada

What problem can occur when a programmer fails to specify the base case or to reduce the size of the problem in a way that terminates the recursive process?

Respuesta :

ibnahmadbello
ibnahmadbello ibnahmadbello
  • 25-01-2020

Answer:

Inifinite loop will occur.

Explanation:

For instance the code block below will result in an infinite loop:

int prev (x){

Return prev (x-1);

}

The base case is what determine when the function should stop calling itself; if it is absent, infinite loop will occur.

In the above code, a base case of when x = 0 or x = 1 should have been added to avoid the infinite loop.

Answer Link

Otras preguntas

607,200 feet per hour what is the speed in miles per hour
What is the central idea of the Ptolemy selection? How does Ball develop this central idea?
What is the sum of 506,211 and 424,809
which parts of a cell are made of molecules?
Explain how you would round the numbers 33 and 89 to estimate their sum
describe the two main types of interactions that environmental scientists study
which anion will form a precipitate with Ca2+
Write an equation in standard form for each line described . 1. The line that is parallel to x-2y+7=0 and contains (-4,0) 2. A. Can the equation of the
Which term is defined as the maximum legal price for a good or service?
Identifying your audience will help you determine A. whether to support your claims. B. appropriate examples to use. C. where to place your thesis