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

Light travels 875 km in material “x” in 5.00 ms. Calculate the speed of light in the material and the material’s index of refraction​
easy question, easy points can someone please explain to me how to do this?
Need help with geometry. Finding the slant height of a pyramid
Most of the universe is believed to be ______ A. dark energy B. dark matter C. baryonic material
What is the product of 2x + y and 5x – y + 3?
how did children's work in industry differ from their earlier contributions to the family economy
More oxygen is given off during the __________when there is more sunlight.
Hey help me on this??
In what way was Harriet Beecher Stowe's book Uncle Tom's Cabin so important to the abolition movement?
Find the missing part Z=