shell sort
Author Message
shell sort

Quote:

> hey, i've got an exam coming up next week, and i need to learn a
> few sort algoritms, but i dont have a good example of this one,
> could one help me?

Grasp textbook (or Sedgewicks "Algorithms" or Wirths "Algorithms +
Data Structures = Programs" firmly in left hand, use right hand to
flip to the index section, use index finger to find "sort" or
"shell sort", adjust open page according to information found, and
begin reading.  Meanwhile use the shift key while entering the
pronoun 'I' or starting sentences, insert the appropriate "'"s in
abreviations, and look up the spelling of algorithm.  Both
spelling and punctuation count in the programming world.

--

Available for consulting/temporary embedded and systems.
< http://www.*-*-*.com/ >  USE worldnet address!

Tue, 15 Nov 2005 23:50:05 GMT
shell sort

Quote:

>hey, i've got an exam coming up next week, and i need to learn a few
>sort algoritms, but i dont have a good example of this one, could one help
>me?

There are many references to the Shell sort on the internet. Just do a
search.

The most common implementation starts by comparing the top of an array
to the value half way down the array. If these are out of order swap
those array values. Proceed all the way through the array, i.e compare
the second array element to the one just past the half way value and
so on until the whole array is compared. If any swaps were made, do
the same thing over again until no swaps are made. Now start the
comparisons by comparing the top value to the one (1/2 of 1/2) 1/4 way
down and so on until the last comparison which compares element 1 with
element 2, element 2 to element 3 and so on.

There are several variants which eliminate repeating the same
comparison interval.

Wed, 16 Nov 2005 00:52:11 GMT
shell sort

Quote:

>hey, i've got an exam coming up next week, and i need to learn a few
>sort algoritms, but i dont have a good example of this one, could one help
>me?

Here's some info, and a great resource.