The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998

18.04.2013 Views

Sorting similar sort routine fragments in C++. See Section for details. XTango (see Section ) is an algorithm animation system for UNIX and X-windows, which includes animations of all the basic sorting algorithms, including bubblesort, heapsort, mergesort, quicksort, radix sort, and shellsort. Many of these are quite interesting to watch. Indeed, sorting is the canonical problem for algorithm animation. Algorithm 410 [Cha71] and Algorithm 505 [Jan76] of the Collected Algorithms of the ACM are Fortran codes for sorting. The latter is an implementation of Shellsort on linked lists. Both are available from Netlib (see Section ). C language implementations of Shellsort, quicksort, and heapsort appear in [BR95]. The code for these algorithms is printed in the text and available on disk for a modest fee. A bare bones implementation of heapsort in Fortran from [NW78] can be obtained in Section . A bare bones implementation of heapsort in Mathematica from [Ski90] can be obtained in Section . Notes: Knuth [Knu73b] is the best book that has been written on sorting and indeed is the best book that will ever be written on sorting. It is now almost twenty-five years old, and a revised edition is promised, but it remains fascinating reading. One area that has developed since Knuth is sorting under presortedness measures. A newer and noteworthy reference on sorting is [GBY91], which includes pointers to algorithms for partially sorted data and includes implementations in C and Pascal for all of the fundamental algorithms. Expositions on the basic internal sorting algorithms appear in every algorithms text, including [AHU83, Baa88, CLR90, Man89]. Treatments of external sorting are rarer but include [AHU83]. Heapsort was first invented by Williams [Wil64]. Quicksort was invented by Hoare [Hoa62], with careful analysis and implementation by Sedgewick [Sed78]. Von Neumann is credited with having produced the first implementation of mergesort, on the EDVAC in 1945. See Knuth for a full discussion of the history of sorting, dating back to the days of punched-card tabulating machines. Sorting has a well-known lower bound under the algebraic decision tree model [BO83]. Determining the exact number of comparisons required for sorting n elements, for small values of n, has generated considerable study. See [Aig88, Raw92] for expositions. This lower-bound does not hold under different models of computation. Fredman and Willard [FW93] present an algorithm for sorting under a model of computation that permits arithmetic operations on keys. Under a similar model, Thorup [Tho96] developed a priority queue supporting file:///E|/BOOK/BOOK4/NODE148.HTM (4 of 5) [19/1/2003 1:30:37]

Sorting operations, implying an sorting algorithm. Related Problems: Dictionaries (see page ), searching (see page ), topological sorting (see page ). Next: Searching Up: Combinatorial Problems Previous: Combinatorial Problems Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK4/NODE148.HTM (5 of 5) [19/1/2003 1:30:37]

Sorting<br />

operations, implying an sorting algorithm.<br />

Related Problems: Dictionaries (see page ), searching (see page ), topological sorting (see page<br />

).<br />

Next: Searching Up: Combinatorial Problems Previous: Combinatorial Problems<br />

<strong>Algorithm</strong>s<br />

Mon Jun 2 23:33:50 EDT 1997<br />

file:///E|/BOOK/BOOK4/NODE148.HTM (5 of 5) [19/1/2003 1:30:37]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!