+ 3

Why we use 'Recursion' function ?

Anyone give answer....... 🙏

31st Oct 2020, 2:49 PM
Dipika😊
Dipika😊 - avatar
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.
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