Re: what type of sort is this?
- From: "user923005" <dcorbit@xxxxxxxxx>
- Date: 26 Jan 2007 18:39:18 -0800
I added a shell sort based on this paper:
http://sun.iinf.polsl.gliwice.pl/~mciura/publikacje/shellsort.pdf
but I found the results very dissapointing. Not sure what I did wrong.
/* BEGIN e_driver.c program output */
Timing 7 different sorting functions.
Sorting arrays of N number of elements,
in 2 different distributions.
The elements are of type long unsigned.
sizeof (long unsigned) is 4.
The times shown are in seconds.
Distribution #1: Shuffled
N s2sort s3sort s8sort spsort DCsort Sesort
optisort
0x1fffff 1.375000 0.656000 0.703000 0.640000 0.640000 0.609000
0.718000
0x200000 4.609000 0.656000 0.750000 0.656000 0.640000 0.641000
0.703000
Total times:
s2sort: 5.984000 e_type Shellsort, 1 / 2 increment ratio
s3sort: 1.312000 e_type Shellsort, 3 / 7 increment ratio
s8sort: 1.453000 e_type Shellsort, 3 / 8 increment ratio
spsort: 1.296000 e_type Shellsort, Sedgewick numbers
DCsort: 1.280000 Gonnet Shellsort
Sesort: 1.250000 Sedgewick Shellsort
optisort: 1.421000 optimal increment insertion sort
Distribution #2: Reverse sorted
N s2sort s3sort s8sort spsort DCsort Sesort
optisort
0x1fffff 0.329000 0.203000 0.219000 0.235000 0.250000 0.250000
0.266000
0x200000 0.359000 0.203000 0.218000 0.234000 0.250000 0.234000
0.266000
Total times:
s2sort: 0.688000 e_type Shellsort, 1 / 2 increment ratio
s3sort: 0.406000 e_type Shellsort, 3 / 7 increment ratio
s8sort: 0.437000 e_type Shellsort, 3 / 8 increment ratio
spsort: 0.469000 e_type Shellsort, Sedgewick numbers
DCsort: 0.500000 Gonnet Shellsort
Sesort: 0.484000 Sedgewick Shellsort
optisort: 0.532000 optimal increment insertion sort
/* END e_driver.c program output */
.
- Follow-Ups:
- Re: what type of sort is this?
- From: user923005
- Re: what type of sort is this?
- References:
- Re: what type of sort is this?
- From: user923005
- Re: what type of sort is this?
- From: user923005
- Re: what type of sort is this?
- Prev by Date: Asymptotic Time Complexity
- Next by Date: Re: Asymptotic Time Complexity
- Previous by thread: Re: what type of sort is this?
- Next by thread: Re: what type of sort is this?
- Index(es):
Relevant Pages
|