[ProgSoc] Multi-index sorting algorithms
James Ducker
jducker at it.uts.edu.au
Tue Dec 21 11:57:52 EST 2010
Hey all,
I'm trying to write a sorting algorithm that can sort a set of data
(the usual, lowest to highest, A-Z, etc), but when it encounters a tie
condition between two values, will defer sorting to another set of
data, which I call the "tiebreaker" set. I'm having a diddly of a
pickle getting it to sort reliably (recursive quicksorting wasn't
working, bubblesorting is working /sort-of/, in that values tend
toward the correct position, but are usually off by one or two slots).
Anyway, does anyone know of some good multi-index sorting algorithms?
- James
PS: Here's a link to the current iteration of my code. It's
JavaScript, /fairly/ legible though.
http://progsoc.pastebin.com/DeZ3Hbnh
Also, original, less-concise, quicksort-based attempt:
http://progsoc.pastebin.com/GurMaRYb
--
James Ducker
Web Developer
http://www.studioj.net.au
More information about the Progsoc
mailing list