previous | start | next

Model for the Examples

The input model in the following examples will just use the input size as the value of N.

The cost model will be to body of the inner for loop (or the single for loop if there is no nested loop). The only operation to count in the inner loop is the single statement:

 sum++;      
   

That is, this will count as 1 operation.

This model seems to make many simplifications, but as seen previously it likely will yield the same tilde approximation and order of growth as a more detailed model.



previous | start | next