Binary insertion sort is ok too if you don't have too many things to alphabetize.
Are the unsigned comments that have been appearing more lately largely the work of a single commenter who is deliberately going nameless? I know Heebie asked this the other day right after Snarkout had accidentally commented without signature, but now I'm asking again.
I think it's our new friend "read."
Read, if that's you, do you mind checking to see that all your comments are signed? We don't do anonymity here.
Comment #2 is by read, citizen. Have no fear, but rather an interest in sorting things by hand.
I've had a lot of jobs that involved sorting things by hand, and I came independently to your very thesis, Ben. You are affirmed.
depending on what state your pile of stuff is in to begin with, I suspect insertion sort will sometimes be the easiest.
Yeah, library sort (which is a variant of insertion sort) is supposed to be quick - it's another O(n log n) comparison method.
Maybe merge sort isn't faster, but it's definitely more satisfying.
I always use insertion sort, but I'll give merge sort a try next time.
I think it would be fun to go back through the archives and see if Sunday has always been "mundane day," like to prep for the rest of the week or something.
Well, the question isn't the speed of the algorithm in general, but the ease of carrying it out, which is why quicksort loses. Insertion sort can require too much flipping here and there through the stack, if it grows too large and the start state is recalcitrant.
Since the stack of papers is more like a linked list than an array, in that you can just stick one paper into it without having to relocate the others, library sort doesn't seem to be relevant.
Hmm, I never gave much thought to what algorithm I use when alphabetizing papers by hand, and as a result, i guess I've always been using insertion sort.
But I want to get this straight. You, Ben w-lfs-n, when alphabetizing papers by hand, look at the first two papers, and move the one that comes first in alphabetical order to the front. Then you repeat this procedure for every pair of papers until the whole stack is alphabetized?
No.
I, ben w-lfs-n, divide the stack into rough halves, then put one to the side, and divide the other into rough halves, until there are four to six in front of me, which I sort using insertion sort (I'm not unreasonable). Then I take the other pile of four-to-six and sort it, and merge them together, then work back up and down in like manner.
You seem to be describing something that either wouldn't work or is similar to bubble sort.
I find the secretary sort requires the least amount of my effort.
I have no previous knowledge of sorting algorithms. I was just trying to figure out what "quicksort" and "mergesort" were using google. Returning to wikipedia, I now see that I was thinking of bubble sort.
If that's mergesort, that what is quicksort?
Nevermind, I get it. I was thrown by this sentence in wikipedia "It starts by comparing every two elements (i.e., 1 with 2, then 3 with 4...) "
FWIW, I use what I now know to call "bubble sort" in organizing books, because I can just move one or two books while I'm, say, waiting for a page to load. And then go about my business, without leaving piles of books on the floor from an unfinished sort.
You know what's fun? Pressure-washing shit is fun. I speak from recent pressure-washing experience.
I can't imagine that washing shit is ever fun. What do you try to remove when you wash shit?
I fantasize about roaming the streets of Budapest with a pressure washer.
We were watching men pressure-washing a street the other day. It looked even more fun than the domestic variety.
you know what's even more fun than pressure washing? Industrial scale sand blasting.
You hung the fruit low, so I picked it.
It never occurred to me to do a quicksort by hand. It would seem that, by your method, dividing up the 5 or 6 piles using a "pivot", then switching to a different sort for the individual piles would be a reasonable procedure.
The "stack of papers" ~ "linked list" observation is interesting. The physical properties of the objects to be sorted have an effect on the sort method in much the same way as data structures do: books on shelves are like arrays; books and CDs give better "random access" than piles of paper; sorting through an entire collection is like working with bounded memory: you have to bring smaller piles into cache and worry about merging them later...
Say, I'll give you my apple core if you let me pressure wash a little.
OT (no more than pressure-washing and sandblasting), but parents and other konnoisseurs of kiddie kulture will be pleased to know that the Suzie Templeton Peter and the Wolf is up on YouTube. Really great.
Works best if an associate known to you goes by the name. Merge, sort.
Bucket sort beats all contenders when it comes to sorting large quantities by hand, at least in my experience.
The fastest way to alphabatize shit is to have someone else do it.
That would be the secretary sort of chet supra, B.
29. Thank you Jesus. That's a cool animation. I hope it stays up on YouTube.
I'm eating a bourbon apple cherry caramel tart and drinking the rest of the bourbon and watching Peter and the Wolf. I freaking love Unfogged right now.
Let's get this out of the way. (He hasn't done anything yet, but…)
Randy Moss!
If I understand correctly what bucket sort it, then I think 31 is exactly right.
That Peter & the Wolf was pretty amazing. I may--may!--have cried a little.
35 & 40: I'm delighted you liked it. Siobhán was pretty frightened by the wolf even though, after seeing the Disney version and hearing the Bernstein and NPR versions about a million times apiece, she knew he was going to get caught.
Jesus, you picked a good name for your kid.
In particular, it's good to see the fada in there where it belongs.
41: But he ate the duck! I know that's part of the plot, but this time it really floored me. That creepy ice-eyed kid and his duck; they were all one another had!
42 & 43: Thanks. Somehow it suits her.
44: I know! That was kind of a shocker. And unlike other versions, the ducks stays eaten.
35: Yay! How is it?
So good. A huge hit, and wasn't even hard to make, but I was way too stingy with the bourbon and cherries; next time I'm doubling everything. Thanks AWB!
Thank you Jesus!
I never cease getting a thrill out of thanking Jesus. Can we please get another commenter named Satan McGee?
14
So why don't you divide into 4-6 piles by first dividing the alphabet into 4-6 sections and then going through the stack once putting each paper in the correct pile based on the first initial of the last name. Then after you sort the piles the merge phase is trivial.
That is a needlessly complicated version of bucket sort, JBS. It's actually much easier to divide the alphabet into 26 sections (I'll let you guess how), since then you can tell at a shot what pile to put something in.
29: This Peter and the Wolf is great. Just starting Part 2. Gracias, Jesús.
De nada, Stanleigh.
Poor duck :(
That is a needlessly complicated version of bucket sort, JBS. It's actually much easier to divide the alphabet into 26 sections (I'll let you guess how), since then you can tell at a shot what pile to put something in.
That approach requires a large amount of horizontal space to do at all, and really good spatial memory to do quickly. Limiting the number of buckets to 4-6, as JBS suggests, hits the sweet spot for me.
I suck at the alphabet, so I'd end up making a lot of mistakes or taking a lot of time.
I do, however, have a good spatial memory, so if I had to alphabetize a whole lot of things, I would do a 26-bucket bucket sort (hot tip: you can reduce horizontal space required by using a grid). Otherwise I'll stick with mergesort.
I have tried the 26-bucket sort, and end up making myself sad. Mergesort still wins the psychological-satisfaction test.
Devices such as this make 26-bucket bucket sorts trivially easy and with minimal space requirements.