Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!ginosko!usc!brutus.cs.uiuc.edu!psuvax1!psuvm!odx From: ODX@PSUVM.BITNET (Tim Larson) Newsgroups: comp.lang.modula2 Subject: Re: Sorts Message-ID: <89255.074225ODX@PSUVM.BITNET> Date: 12 Sep 89 11:42:25 GMT References: Organization: Penn State University Lines: 20 In article , BOTCHAIR@UOGUELPH.BITNET (Alex Bewley) says: > > Bubble sort is a little bit too slow for my application. I need to sort > a linked list in memory. The algorithm I want must not use or > require a FIXED array to sort, as the list is dynamic. Still not quite enough information to tell, but you may not need to sort at all if it's a linked list! That is, as you load each element in the list, simply link it in in-order. When the last element is added, the list is sorted already. I used this technique once in school, when a grade depended on it (we were graded partially on how fast our program was in comparison to the rest of the class). In that case, my program outperformed all the programs that performed sorts. If the list is long, and you can afford a bit more space, this can be made more efficient by using two links and a tree structure. I don't know if this applies to your situation, but maybe there is a germ of an idea you can use here. -Tim Larson odx@psuvm.bitnet