Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What's this place anyway

Name: Anonymous 2014-05-09 17:18

It sure isn't about programming

Name: Anonymous 2014-05-09 17:24

Yes it is.

Property E. The number of compares used by shellsort with the increments 1, 4, 13, 40, 121, 364,... is bounded by a small multiple of N times the number of increments used.
Evidence: Instrumenting Algorithm 2.3 to count compares and divide by the number of increments used is a straightforward exercise (see Exercise 2.1.12). Extensive experiments suggest that the average number of compares per increment might be N 1/5, but it is quite difficult to discern the growth in that function unless N is huge. This property also seems to be rather insensitive to the input model.

Experienced programmers sometimes choose shellsort because it has acceptable running time even for moderately large arrays; it requires a small amount of code; and it uses no extra space. In the next few sections, we shall see methods that are more efficient, but they are perhaps only twice as fast (if that much) except for very large N, and they are more complicated. If you need a solution to a sorting problem, and are working in a situation where a system sort may not be available (for example, code destined for hardware or an embedded system), you can safely use shellsort, then determine sometime later whether it will be worthwhile to replace it with a more ophisticated method.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List