Re: Help needed for a sorting code in the literature
From: BRG (brg_at_nowhere.org)
Date: 12/31/04
- Next message: Bob Harris: "Re: Help needed for a sorting code in the literature"
- Previous message: crazyfly: "Re: crypt question"
- In reply to: BRG: "Re: Help needed for a sorting code in the literature"
- Next in thread: Mok-Kong Shen: "Re: Help needed for a sorting code in the literature"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 31 Dec 2004 13:48:36 +0000
BRG wrote:
> Mok-Kong Shen wrote:
>
>> The code of the heapsort algorithm as given in books by
>> e.g. Sedgewick deals with arrays with indices of the kind
>> a[1..n]. For PLs like C, one would like to sort arrays with
>> indices of the kind a[0..n-1]. I have found sofar only one
>> book that gives code for the latter case, namely "Numerical
>> Recipes in C++" by W. H. Press et al. (which itself refers
>> to Sedgewick). I adapted the code there (which is in C++
>> and is capable of dealing with a variety of data types being
>> sorted) to C for sorting arrays of 'int'.
>
>
> Here is a C++ version of a bottom up heapsort that should be easy to
> convert to C. No guarantees that it is correct though - posting code
> here is a virtual guaranetee that someone will find bugs in it :-)
[snip]
I have even found one myself :-(
Brian Gladman
- Next message: Bob Harris: "Re: Help needed for a sorting code in the literature"
- Previous message: crazyfly: "Re: crypt question"
- In reply to: BRG: "Re: Help needed for a sorting code in the literature"
- Next in thread: Mok-Kong Shen: "Re: Help needed for a sorting code in the literature"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|