previous | index | next

Linear Iteration

power-product generates an iterative (repetitive) process because:

Q: How many times is power-product called (in terms of e)?

A: e times

Since most of the computing cost in power-product is bound up in the recursive call, the time it takes to compute is Θ(e).

This is an example of linear iteration, since the number of repetitions is linear in the exponent.

Q: What is the maximum number of waiting multiplications (in terms of e)?

A: 0 multiplications

Since there are no waiting multiplications, there is no extra memory required, so the amount of memory required by power-product is constant, or Θ(1).


previous | index | next