Past (20 years or so) and present code. A variety of languages and platforms. Some gems. More gravel. Some useful stuff and some examples of how not to do it.
Tuesday, October 11, 2005
[VScript] At last, a working shell sort
Finally found a shell sort that works. The problems I had previously might have been had because of this:
I converted that straight to VBScript and kept crashing because a[j-h] with a negative index would get evaluated. By using a do/loop and breaking the test up into two parts
... I got stuff to work. Here's the code. Usage is similar to that for heap sort.