Let's look at what each call does. Each call, when n > 1,
- Does exactly two multiplications, then
- Makes a recursive call on a problem of size n - 1
Therefore, we can write the recurrence as
- M(1) = 1
- M(n) = 2 + M(n-1)
If you use the iteration method, you'll notice this pattern:
- M(1) = 1
- M(2) = M(1) + 2 = 3
- M(3) = M(2) + 2 = 5
- M(4) = M(3) + 2 = 7
- ...
- M(n) = 2n - 1
Now that you have this, you can write it asymptotically as M(n) = Θ(n).
Hope this helps!