Add my changes to recursion . (#25155)
It describes the usage and importance of a base condition.
This commit is contained in:
@ -177,6 +177,8 @@ int divides(int a, int b) {
|
||||
|
||||
```
|
||||
|
||||
NOTE: In recurssion a base codition is mandatory. Otherwise the function executes infinitely.There can be more than one base condition In the above case the bese conditions are if(n<0) and if(n==0) .
|
||||
|
||||
# Before you go on...
|
||||
## A review
|
||||
* Functions are good to use because they make your code cleaner and easier to debug.
|
||||
|
Reference in New Issue
Block a user