3.3. General Case

Looking back a few steps in the analysis of this code, what can we say about the average-case complexity before looking at the specific input distribution?

Let kavg denote the average number of times that the loop is executed.

Then we quickly conclude that the loop is `O(k_{avg})`.

and so, in fact, is the entire function.


In the Forum:

(no threads at this time)