Header Ads Widget

Rules of the recursion

 Recursive function are the function are the function which called itself . and this processor is known as recursion . Recursion follow some rule and regulation . which are listed below...

Rule of Recursion :- (Property of Recursion)
                                                                      Any recursive function must have following properties.
1. Should have a  base case.( A base Case is the Case where the recursive function gives the concrete (exact) solution to the input. And therefore it helps  in terminating the recursive function).
2. The recursive processor must proceed towards base case during the execution
3. There should be a recursive Call .

One more categorization of the recursion is as follows.

1. linear recursion :- A linear recursion includes only one recursive call inside the body of the  function.

2.Binary recursion :- In this type of recursion the body of the function has two recursive call.

Recommended Post:

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-


Post a Comment