Is there any situation where you want an optimized case of sorting long lists of many similar elements and doesn't care about being stable?
/ Mirar
Previous text:
2003-04-23 20:32: Subject: sort
It's very simple: Just remember the original position and sort on that when items are equal otherwise. That requires a little bit more memory so a separate stable version could be considered. But I don't think it's worth the trouble since sort() already temporarily allocates memory linear to the size of the sorted array.
/ Martin Stjernholm, Roxen IS