Should you use recursive function calls in C / C ++?
I am working on machine learning / data mining, so it is very important for me to make my code scalable.
When I used Java, I avoided using the recursive call as much as possible because I often overloaded my call stack. Although there are options for controlling the amount of memory allocated to the call stack, I thought it was more likely that my program depended on fewer parameters. Therefore, when it becomes clear how to implement without a recursive call, perhaps using a stack managed by me, I did it. But I'm not sure if this is the right discipline even in Java.
As far as I know, there is no call stack in C / C ++, so I would not worry about its overflow. So, I am curious: will you try to avoid using recursion, or is it recommended, or is it a problem in terms of the scalability of your program?
source
share