[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sort algorithms



PureBytes Links

Trading Reference Links

>for a perspective on sort algorithms this link has some good examples
>demonstarting their relative efficiency ...
>
>http://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.html

Oftentimes, in tradestation, one doesn't need to sort long lists, in
which case the low overhead of a selection sort (which is a bubble sort
having the swap step outside the inner loop) is probably most efficient.
Otherwise, the best overall sort algorithm is probably the heapsort,
which approaches the quicksort in speed but has low overhead and can
operate "in place" without an auxiliary array.

I have an EasyLangage version of the heapsort at
http://unicorn.us.com/trading/src/_heapsort_a.txt

-- 
  ,|___    Alex Matulich -- alex@xxxxxxxxxxxxxx
 // +__>   Director of Research and Development
 //  \     Unicorn Research Corporation -- http://unicorn.us.com 
 // __)    HTML FORMATTED MAIL SENT HERE WILL BE REJECTED AS SPAM.