+ 3
Why we use 'Recursion' function ?
Anyone give answer....... 🙏
6 odpowiedzi
+ 9
Because it's much easier to think of a recursive approach to some problems then comming up with an interative approach for the same.
+ 3
Because sometimes we can not use loops. Like to remove all the files from a directory.
+ 2
we use recursion to call recursion
to use recursion to call recursion
to use recursion
....
until we reach the base case.
+ 1
also some algorithms need recursion approach to solve and most of them are Divide and conquer problems .
+ 1
Recursion helps us to see how elegant something can be implemented. Recursion also simplifies code most of the time.