Explore BrainMass

Explore BrainMass

    Write a recursive algorithm

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a recursive algorithm to multiply two numbers.

    Mult(a,b) = a
    Mult(a,(b-1))+a
    if b = 1
    if b > 1

    © BrainMass Inc. brainmass.com March 4, 2021, 5:41 pm ad1c9bdddf
    https://brainmass.com/computer-science/algorithms/write-a-recursive-algorithm-5903

    Solution Preview

    if (b==1)
    <br> mult(a,b)=a;
    <br>if (b>1)
    <br> mult(a,b)=a + mult(a,(b-1))
    <br> =a + (a + ...

    Solution Summary

    This job helps to write a recursive algorithm.

    $2.49

    ADVERTISEMENT