What are the three criteria of Recursive Design Techniques in confirming that the recursive function is correct? Give examples?
Before diving into the problem, let's just go through the definition of the term, 'recursion'. Recursion is nothing but a process in which a function calls itself either directly or indirectly based on the user's choice is called Recursion.
Using recursion, certain problems can be solved efficiently and in an easy manner. For example:
(i) Tower of Hanoi Problem (ii) F+Calculating the factorial of a number
Technically, the three main criteria of recursive design techniques in confirming that the recursive function is correct are as follows:
(1) Dividing your problem statement into more than one simpler or smaller parts. Make it a sub-problem.
(2) Call the recursive function on each & every sub-problem.
(3) Combine all the results into a solution of the original problem.
If you like my work, please DROP A LIKE on the post for the efforts. I really need it, thanks in advance!
Get Answers For Free
Most questions answered within 1 hours.