TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: TIM HUTZLER
from: MATHIEU BOUCHARD
date: 1998-05-12 03:12:00
subject: Re: Sorting linked list

 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.