fastest sorting???

Started by
22 comments, last by vaneger 20 years, 2 months ago
quote:Original post by Anonymous Poster
Marek

PS If you have a parallel sorting algorithm that I can compare mine against. Send me an email: m.olszewski @ utoronto.ca.


Aha, I recognize that name This guy is continuing (in a rather different direction, apparently) on my (undergrad) thesis work, and knows what he''s talking about here.

(It''s worth noting that stablesort() will guarantee, well, a stable sort - i.e. if x comes before y in the original list, and x "equals" y according to the comparison function, then x will be before y in the sorted list. Removing this guarantee sometimes allows faster sorting, but when this property is needed, make sure you have it. )

To elaborate: for my thesis I tried to develop AI to optimize divide-and-conquer algorithms, by choosing the ''subalgorithm'' to use at each step. I happened to choose sorting as my "test problem", so it basically attempted to do what std::sort() does, except gathering a bunch of raw data in order to determine the cutoff points for switching the sorting method - and also not using very sophisticated sorting code, because I was writing it all myself :/ A fine example of how not to do real-world work, but it made for interesting study. (It was also my last - in the sense of most recent, but hopefully I won''t have to again! - attempt at using C++, which has never worked out very well for me. I figured I needed the template generics though. Oh well.)

BTW, the code I wrote is available at http://jove.prohosting.com/~zahlman/DaCAlOpE/DaCAlOpE.tar.gz.
You will need to download the "c4.5" decision tree code yourself, because of the author''s licensing terms.
Advertisement
One convenient thing about mergesort is that it always takes the same amount of time on a given list length.

Could be usefull in a realtime application, like a game, if worst case behaviour is critically bad and nlogn best case is sufficient.
http://www.critticall.com/sort.html
http://www.critticall.com/sortmaker.html

just for reference

Abnormal behaviour of abnormal brain makes me normal...www.zootfly.com
Wikipedia has a nice page on sorting too:
http://en.wikipedia.org/wiki/Sort_algorithm

This topic is closed to new replies.

Advertisement