Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site cca.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!unc!mcnc!decvax!cca!g-rh
From: g-rh@cca.UUCP (Richard Harter)
Newsgroups: net.math
Subject: YASMP (Yet Another Sorting Methods Posting)
Message-ID: <3219@cca.UUCP>
Date: Tue, 9-Jul-85 04:18:51 EDT
Article-I.D.: cca.3219
Posted: Tue Jul  9 04:18:51 1985
Date-Received: Thu, 11-Jul-85 07:48:14 EDT
References: <3070@cca.UUCP> <> <3130@cca.UUCP> <>
Reply-To: g-rh@cca-unix.UUCP (Richard Harter)
Organization: Computer Corp. of America, Cambridge
Lines: 19
Summary: 

One further note on Bill Stewart's nice article on radix/comparison
sorting:  Bill says that a comparison sort is m*n*log n where n is
the number of records and m is, roughly, the key length, and that
radix sorting is m*n.  (The m's are somewhat different in each case.)
Bill restricts his discussion to character strings.  He gives code
the comparison step in comparison sorts and pseudocode for the radix
sort.

In principle the 'm' of the comparison sort can be reduced to O(1).
The reason is that in the early passes almost all comparisons differ
in the first byte (assuming reasonably random keys).  In later passes
the byte at which they differ is a later than the first.  Within
a sublist, however, the high order bytes of the keys will all be the
same so the comparison loop can start at a later point.  (Of course,
this amounts to using radix sort techniques in a comparison sort.)

				Richard Harter

RH:rn