Chapter 6 Optimizing for Optimistic Scenarios
A Common-Sense Guide to Data Structures and Algorithms, Second Edition — Pragmatic Programmers (56 / 226)
Until this point, we’ve focused primarily on how many steps an algorithm would take in a worst-case scenario. The rationale behind this is simple: if you’re prepared for the worst, things will turn out okay.
However, you’ll discover in this chapter that the worst-case scenario isn’t the…