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 the Editorial Director, Journals Policy for Oxford University Press. He serves on the Board of Directors for the STM Association, the Society for Scholarly Publishing and CHOR, Inc. David received his PhD in Genetics from Columbia University and did developmental neuroscience research at Caltech before moving from the bench to publishing.

View All Posts by David Crotty

Discussion

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.