TH> DM>Quicksort needs to be able to quickly find
TH> DM>arbitrary nodes and swap them.
TH> MB>This ain't no quicksort, afaik.
TH> Maybe he is refering to the partitioning function...
Maybe I don't understand, too.
TH> MB>quicksort, mergesort, heapsort are in n log n time. how do you expect
TH> MB>that sorting a collection of n elements takes less than n time?
TH> MB>(unless it is pre-ordered to a certain extent, in a known manner)
TH> Regular Quick sort is a poor performer with pre-sorted arrays. The
TH> imporved ones that take multiple samples for determining the mean
TH> tend to do better, ie. the first, middle, and last average method.
TH> If someone needs to add, or update a list, then resort it, a bubble
TH> sort will probably do the trick.
but a bubble sort still can't do better than O(n) on sorted arrays.
matju
--- Terminate 4.00/Pro
---------------
* Origin: The Lost Remains Of SatelliteSoft BBS (1:163/215.42)
|