Advantage of Recursion
As we know, a program that can be executed using the recursive function can also be executed using the iterative loop.let's, take an example to calculate the factorial of a number using iteration and recursion.
In the above program, using recursion requires fewer lines of code as compared to iteration.
If you want your code to be short and easy to understand then you can use recursion.
recursion plays a very important role in the tree traversal.
1 Comments
Amazing content, you can find more content related to C Programming here.
ReplyDeletePost a Comment