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

You have 5 pounds and 10 ounces of laundry. Your washer has a capacity of 7 pounds. How many more ounces of laundry would you need to make a full load?
what does 'secret, black and midnight hags' mean in shakespeare?
Round 1.069 to the nearest tenth
Collect information about working of geyser and prepare a report
what is 12.345 rounded to the nearest tenth
the total cost of 3 tables & 2 chairs is rs 1850 ...if a table RS 75 more than a chair ,find the price of each ?
A soccer ball is kicked straight up from the ground with an initial velocity of 32 feet per second. Its height above ground in feet is given by: s(t)=-16t^2 +32
Find the 6th term in the expanded form of the equation (2x+y)^9
write a paragraph on my favourite teacher
what is 12.345 rounded to the nearest tenth