Ask Question

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?

+2
Answers (1)
  1. 31 May, 23:09
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “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 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers