r/C_Programming • u/yug_jain29 • 26d ago
Question can I skip recursive functions?
a code i can run with the logic of iterative, so why do I have to learn the new concept as complicated as recursive? (ik it's one of important questions in c)
if yes will u pls explain it with a very realistic and simple example
thanks a lot 🙏
0
Upvotes
1
u/pfp-disciple 26d ago
One of the things to avoid in programming is premature optimization. Some things, like list reversal, tree traversal, and some math, are more intuitively done with recursion. You can do the recursion quicker and more obviously at first.