Data Structures & Algorithms

Average-Case Analysis: What Does Typical Mean?

4:17

Plays from YouTube. Watch on YouTube

What does it actually mean to say an algorithm is fast 'on average'?

Meet average-case running-time analysis through probability and expected values.

We begin by separating best-case, worst-case and average-case costs, then specify a uniform successful-search model.

From there, we derive the exact expected comparisons for linear search and extend the formula to missing targets.

Finally, we compare quicksort's worst and expected behavior and explain why workload distributions and empirical measurements matter.

The big idea: an average only has meaning after you say what is being averaged and how cases are weighted.

Algorithm analysis explained visually, one concept at a time.