Alphanum algorithm posted to Reddit
Between 8:00pm and 9:00pm today, I had received four emails from people about my Alphanum algorithm for sorting mixed strings and numbers in a natural order (i.e., not ASCII). Weird, I usually get Alphanum emails every season or so, not four times in one hour! Something seemed to be afoot.
Turns out that someone had posted link to my page on Reddit (here’s the link). I think that’s the first time a page of mine had ever been blogged without me expecting it – not that I’m complaining, of course. I’m very glad other people are finding value in this!
Here’s my favorite comment thread.
Advertisement
Categories: Usability
Wow! I was looking for just this algorithm–one that sorts larger numbers after smaller numbers like a human would, but also alphabetically. So I did some searches on Google and I thought the one you wrote looked the simplest and probably the best. So I copied the file into one of my projects and it works great! Thanks.
I wonder if you could use an array and look up whether a character is 0-9 in the C# version. I might benchmark and see if I could improve it somehow, but not right now.
What I was trying to do was sort a list of highways for a traffic monitoring program. I had thought Word or Excel could do this, but I couldn’t make that work.
Stumbled upon your blog a week ago and decided to come back. Not for the articles you write, but for how you write them, really amazing stuff you’re doing here, i like how you put information into the articles which makes it much more easier to read and much more interesting of course. Keep up the good work!