Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site orca.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!ucbvax!ucbcad!tektronix!orca!andrew From: andrew@orca.UUCP Newsgroups: net.lang Subject: Re: A Simple Bubble Sort Function Message-ID: <894@orca.UUCP> Date: Fri, 15-Jun-84 02:54:14 EDT Article-I.D.: orca.894 Posted: Fri Jun 15 02:54:14 1984 Date-Received: Tue, 19-Jun-84 01:13:56 EDT References: <965@ihuxq.UUCP> <165@callan.UUCP> <131@godot.UUCP> <2096@mit-eddie.UUCP> <7471@umcp-cs.UUCP> Organization: Tektronix, Wilsonville OR Lines: 26 The continued popularity of the bubble sort is perplexing. In Knuth's "Sorting and Searching" [1], the definitive work on the subject, the author invests several pages and quite a bit of math in an exhaustive mathematical analysis of the bubble sort, and concludes: "It took a good deal of work to analyze the bubble sort; and although the techniques used in the calculations are instructive, the results are disappointing since they tell us that the bubble sort isn't really very good at all. Compared to straight insertion, bubble sorting requires a more complicated program and takes about twice as long! "Some suggestions can be given for improving the bubble sort ... But none of these refinements lead to an algorithm better than straight insertion ... "In short, the bubble sort seems to have nothing to recommend it, except a catchy name and the fact that it leads to some interesting theoretical problems." [1] Knuth, Donald E., "Sorting and Searching", volume 3 of "The Art of Computer Programming", Addison-Wesley, 1973. -- Andrew Klossner (decvax!tektronix!orca!andrew) [UUCP] (orca!andrew.tektronix@rand-relay) [ARPA]