+ 3

Why we use 'Recursion' function ?

Anyone give answer....... šŸ™

31st Oct 2020, 2:49 PM
DipikašŸ˜Š
DipikašŸ˜Š - avatar
7 Answers
+ 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.
31st Oct 2020, 2:53 PM
Arsenic
Arsenic - avatar
+ 3
Because sometimes we can not use loops. Like to remove all the files from a directory.
31st Oct 2020, 2:52 PM
šŸ‡®šŸ‡³VivekšŸ‡®šŸ‡³
šŸ‡®šŸ‡³VivekšŸ‡®šŸ‡³ - avatar
+ 2
we use recursion to call recursion to use recursion to call recursion to use recursion .... until we reach the base case.
31st Oct 2020, 3:03 PM
Shadoff
Shadoff - avatar
31st Oct 2020, 3:07 PM
Jayakrishna šŸ‡®šŸ‡³
+ 1
also some algorithms need recursion approach to solve and most of them are Divide and conquer problems .
31st Oct 2020, 4:21 PM
MohammadErfan Gooneh
+ 1
Recursion helps us to see how elegant something can be implemented. Recursion also simplifies code most of the time.
1st Nov 2020, 3:31 PM
Donato Paul Thayalan
Donato Paul Thayalan - avatar