Tuesday, October 03, 2006

A Quick Study On Sorting Alphanumeric Values

For all the smarty-pants out there:
An interesting question came up at work today... What is the easiest way to sort alphanumeric values? Simply, for example, ABC1C goes before RST2B. The problem is, what do you do with HIJ100A? (These values are arbitrary) Sorting as you normally would, comparing values left to right, this value would go in the middle of the list, but it should really be at the end. The solution agreed upon was looking at the values as Base 36, converting them to decimal for the sorting, and converting them back to Base 36 when finished. I'm interested to see what other creative ideas you guys can come up with to solve this problem with similar (or greater) efficiency. Discuss.

10 comments:

Jae said...

Am I getting paid if you use my idea? :)

Anonymous said...

Niner

Adam said...

What ever happened to good old 1 through 10? I miss the old days of simplicity.

Logan said...

since when did letters become numbers?

Nick D said...

I cant read Egyptian baxter you know this

Andrew said...

Alphanumeric values? I barely took a math class in college, fufilled my requirement with Sats 101, so how the hell would I know anything about this crap. N=300

Amanda said...

It's official. My brother got all of the brains my parents could produce; they coasted along to me on fumes.

Leighton said...

Phew, I thought I was the only one who had clue what he was talking about!

Chris said...

I like cookies!

Alex said...

I slept in math class