human sort
Aug. 21st, 2010 04:05 pmvia
vgqn, What different sorting algorithms sound like.
The video label claims that it is "quite boring until you add sound effects," but I thought it was quite interesting even without. A little checking with the appropriate wikipedia article told me how these algorithms work.
This inspires me to talk about human-sort: my ways of sorting physical objects into a predetermined order. Often enough that order is alphabetical. OK, let's say I have to sort a number of file cards. If there's more than a couple dozen of these, I sort them by dividing them into smaller and smaller fractions of the alphabet, down to the point where there's few enough that I can do a direct insertion sort (taking each successive card and putting it into the proper slot) without awkwardness or inconvenience.
I start by sorting them into three piles: A-G, H-P, and Q-Z, a division originally inspired by the musical phrases of the alphabet song. If the collection is small, it may be possible to do an insertion sort on each of those piles. Otherwise, I move the other two piles out of the way and re-sort the A-G into 7 piles by initial letter, then if necessary re-sort each of those piles by second letter, and so on.
However, when I had to sort several hundred science fiction paperbacks by author, it was clear that even if I began with 26 piles instead of 3, some of them would quickly grow so high that they'd topple over, and I hardly had room on the nearby floor for that many piles anyway. The books were already on the shelves where they'd belong, so instead I tried a kind of mixed insertion-selection-merge sort. It worked like this. I alphabetized each individual shelf of about 25 books. Then I went through each of them and pulled down all the A's, and alphabetized them. Then I put those A's on the first shelf, making room for them by taking down the remaining books on that shelf and putting them in their proper alphabetical place on various other shelves, wherever they'd fit. Then I did the same with the B's. That way I got my sorting done without ever having to take all the books down at once.
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
The video label claims that it is "quite boring until you add sound effects," but I thought it was quite interesting even without. A little checking with the appropriate wikipedia article told me how these algorithms work.
This inspires me to talk about human-sort: my ways of sorting physical objects into a predetermined order. Often enough that order is alphabetical. OK, let's say I have to sort a number of file cards. If there's more than a couple dozen of these, I sort them by dividing them into smaller and smaller fractions of the alphabet, down to the point where there's few enough that I can do a direct insertion sort (taking each successive card and putting it into the proper slot) without awkwardness or inconvenience.
I start by sorting them into three piles: A-G, H-P, and Q-Z, a division originally inspired by the musical phrases of the alphabet song. If the collection is small, it may be possible to do an insertion sort on each of those piles. Otherwise, I move the other two piles out of the way and re-sort the A-G into 7 piles by initial letter, then if necessary re-sort each of those piles by second letter, and so on.
However, when I had to sort several hundred science fiction paperbacks by author, it was clear that even if I began with 26 piles instead of 3, some of them would quickly grow so high that they'd topple over, and I hardly had room on the nearby floor for that many piles anyway. The books were already on the shelves where they'd belong, so instead I tried a kind of mixed insertion-selection-merge sort. It worked like this. I alphabetized each individual shelf of about 25 books. Then I went through each of them and pulled down all the A's, and alphabetized them. Then I put those A's on the first shelf, making room for them by taking down the remaining books on that shelf and putting them in their proper alphabetical place on various other shelves, wherever they'd fit. Then I did the same with the B's. That way I got my sorting done without ever having to take all the books down at once.