Sitting in my ever-cluttered office, the idea of one day having the time to sort out my bookshelves seems a wonderful, but likely unattainable dream. But suppose something magical happens — what would be the quickest way to get my books organized?

The video below sets up the following situation: you work in a library and a shipment of 1,280 books arrives. You need to get them in alphabetical order as quickly as possible. It then walks through different sorting methods: a bubble sort, insertion sort, and a quick sort. At the end, the comparison is made to how these methods relate to computational algorithms used to sort data.

David Crotty

David Crotty

David Crotty is a Senior Consultant at Clarke & Esposito, a boutique management consulting firm focused on strategic issues related to professional and academic publishing and information services. Previously, David was the Editorial Director, Journals Policy for Oxford University Press. He oversaw journal policy across OUP’s journals program, drove technological innovation, and served as an information officer. David acquired and managed a suite of research society-owned journals with OUP, and before that was the Executive Editor for Cold Spring Harbor Laboratory Press, where he created and edited new science books and journals, along with serving as a journal Editor-in-Chief. He has served on the Board of Directors for the STM Association, the Society for Scholarly Publishing and CHOR, Inc., as well as The AAP-PSP Executive Council. David received his PhD in Genetics from Columbia University and did developmental neuroscience research at Caltech before moving from the bench to publishing.


4 Thoughts on "Algorithmic Approaches to Sorting Out Your Bookshelf"

It seems to me that for library books the first sort would be by subject category, before any alphabetization takes place. That’s how I sorted the 3,500 books in my library.

Then change the problem — you get a huge shipment of books in subject category X, and you want to line them up alphabetically by author. Or you get a huge shipment of books that you sort by subject, and now want to arrange by author. Either way, there’s still some alphabetization to happen.

There’s actually a much easier way of doing this. That take no comparisons at all. Group it by beginning alphabet. Bring all the a’s to the front, then all the b’s, and so on. It’s like quick sort without these made up partions. The Patriots would be predetermined. Then go by second letter, and so on. This is how we sort at our library.

Comments are closed.