Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!hao!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.lang Subject: Re: A Simple Bubble Sort Function Message-ID: <7524@umcp-cs.UUCP> Date: Sun, 17-Jun-84 18:43:34 EDT Article-I.D.: umcp-cs.7524 Posted: Sun Jun 17 18:43:34 1984 Date-Received: Wed, 20-Jun-84 01:05:22 EDT References: <965@ihuxq.UUCP> <165@callan.UUCP> <131@godot.UUCP> <2096@mit-eddie.UUCP>, <7471@umcp-cs.UUCP> <269@harvard.UUCP> Organization: Univ. of Maryland, Computer Science Dept. Lines: 13 To forestall further comments: yes, I know quicksort can be modified such that sorting an already sorted list is no longer O(n^2). (In fact, the ``qsort'' routine in the C library is already so modified, I believe.) However, the point remains that if you know a great deal about the input data, you can almost always come up with something better than a ``generic'' sort algorithm. For instance, if you know that at most one item is out of place, you shouldn't use any of the standard sorts. Just don't claim that some particular sort is ``the best,'' because there is no single best sort. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland