0

recursion

what is recursion in c++ and also the advantage and disadvantage ?

24th May 2019, 2:41 PM
Muluken Mnyahl
Muluken Mnyahl - avatar
1 Odpowiedź
+ 2
Recursion happends when a function calls itself. The advantages is that you can write short algorithms for some tasks (like factorials). A disadvantage in c++ is that you have a recursion limit (because of the Stack).
24th May 2019, 2:56 PM
Théophile
Théophile - avatar