Ask Question

Explain the benefits a recursive algorithm can provide. Use an example from a process in your organization or with which you are familiar.

+4
Answers (1)
  1. 2 March, 13:25
    0
    Recursion is when the function calls itself inside it's definition. The advantages of recursion are as following:-

    The problems solved by recursion have small code and elegant as compared to it's iterative solution which will be big and ugly to look at. Recursion is best suitable for data structures such as trees it's solution more understandable and easy while it's iterative solution is very big and also a bit difficult.

    #include

    using namespace std;

    int factorial (int n1)

    {

    if (n1 = = 0)

    return 1;

    return n1 * factorial (n1 - 1);

    }

    int main ()

    {

    int no;

    cin>>no;

    cout<
    return 0;

    }

    Recursive function to find the factorial of a number.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Explain the benefits a recursive algorithm can provide. Use an example from a process in your organization or with which you are familiar. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers