Sorting algorithms
thedeemon
dlang at thedeemon.com
Mon Oct 15 08:49:50 PDT 2012
On Monday, 15 October 2012 at 09:18:12 UTC, Era Scarecrow wrote:
> Been watching online lectures that's going into sorting and
> searching, and from what I'm seeing most sorting algorithms (by
> using comparison; merge sort, quicksort, etc) and even tree
> algorithms peak at O(n log n). So an example area to be sorted
> with 16 elements would take on average about 100 compares while
> theoretically you can do it in half that number.
Big-O notation doesn't give you actual numbers, O(n) = O(25*n).
If you're interested in a practical method, look at TimSort and
similar ones that combine different algorithms.
More information about the Digitalmars-d-learn
mailing list