Share
Explore BrainMass

Write a recursive algorithm

Write a recursive algorithm to multiply two numbers.

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

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.19