Hoare introduced and analyzed the Quicksort algorithm in the early 1960s 6. By the early 1970s, a highly tuned version of that algorithm was implemented in the Unix system’s main memory sort function,
qsort. For two decades, that code performed admirably.
In the early 1990s, Alan Wilks and Rick Becker once again used that old, reliable program, and were stunned by the results.
A run that should
... [Show full abstract] have taken a few minutes was cancelled after hours. They studied their input data and eventually produced
an eight-line program that showed that their run would have taken weeks. They enclosed that program in a superb bug report
that they e-mailed to me (details are described by Bentley [1]). They had stumbled across a problem that Hoare had foreseen: selection of the partitioning element. An implementation cleverness
that had stood the test of two decades worth of time had finally failed catastrophically.