The surrounding books are then moved left or right of the partition depending on where they belong, which results in two subsets of books. The process is repeated, by choosing a partition between A and M, and another between N and Z, until there are four groups of books which are relatively close to each other in alphabetical order. The process runs until the groupings are small enough to easily sort the books individually.

According to Chand, using quicksort instead of other sorting methods would give you back days of your life otherwise spent sorting. In his analogy, Chand compares quicksort’s efficiency with the “bubble sort” and “insertion sort” methods, which are taught in beginner computer science classes. Bubble sorting, as applied to books, would involve systematically comparing one pair of books at a time and always moving the book that belongs last to the back spot, if it isn’t already there. After moving through your bookshelf this way—pair by pair—you’d discover which book belongs at the very end, and then go back to the beginning to repeat the process.

The insertion method, which is how most people naturally sort books, would have you compare the first two books on your shelf and swap them if necessary, then compare the third book to the second book and swap again. This difference here is that you’re arranging the books correctly as you move down the line.

Chand estimates that sorting 1,280 books that arrived in a straight line using the bubble method would take a person nine days, if each comparison took one second. Using the insertion method would add up to nearly five days of sorting. Using quicksort—with seven rounds of dividing and perfectly balanced partition sections—would get the job done in 3.3 hours, he says.

That would free up at least a week’s worth of reading that most of us wish we could do, but rarely ever pull off.

📬 Sign up for the Daily Brief

Our free, fast, and fun briefing on the global economy, delivered every weekday morning.