                               Visual Sort Demo

                By Anthony Watson, Blake Arnold, and Don Ravey
-------------------------------------------------------------------------------
From Anthony Watson:

  While working on a new project for the ST, I recently became interested in
alternative methods for sorting data. My particular applications did not allow
the use of the built-in SSORT and QSORT commands, so it was necessary to write
my own. While the 'bubble sort' routine I was using worked fine, it was rather
slow (Before I found this program, I didn't even know what my method was
called?) So, I did a little searching for more information on sorting.

  My searching turned up source code for many sort routines, in many
programming languages. But one program really caught my eye. It was a VISUAL
representation of how each of four sort methods operated, and provided time
differences for each method. To top it off, it was written in GFA Basic, which
made my understanding of the procedures much easier.

  First, I must thank Don Ravey for writing the original routines in ST-Basic,
and Blake Arnold for the conversion to GFA Basic. I truly appreciate their
hard work, and their generosity in sharing the source code. In hopes that
others may continue to learn from this program as I did and perhaps improve on
it, I am including not only MY version, but each of the original programs as
well.

  While Blake Arnolds update was a nice translation, I did not require the
multi-resolution capability, so my version runs in ST Medium ONLY. Also, the
use of 'GOTO' is a definate NO-NO as I understand it, so I set out to
eliminate those and just generally streamline the program whenever possible.
To his credit, Blake indicated his was a 'ROUGH' translation, and I do not
wish to criticize his work. Indeed, without it, I may not have understood
these sort routines at all! In fact, many of you may take exception to 'MY'
programming practices. I know there are still many areas in the program which
could be further improved, but I learned what I needed to learn, so I'm moving
on. I personally encourage you to enhance these routines if you can.

"Sort it out..."

Anthony Watson

-------------------------------------------------------------------------------

From Blake Arnold:

 Converted to GFA Basic and enhanced - "just for kicks"!

 Original ST-Basic version by Don Ravey (1986).  The original version ran only
in medium res, and did not give sort times for the routines.

  This program visually demonstrates 4 different sort routines: A bubble sort,
an insertion sort, a shellsort, and a quicksort.

  Each sort routine has certain advantages.  A BUBBLE SORT is the simplest,
and fine for small amounts of data where speed isn't critical.  An INSERTION
SORT is a little faster than a bubble sort, and again useful for small amounts
of data.

  The SHELLSORT and QUICKSORT are both much more complex than the routines
mentioned above, but both the SHELLSORT and QUICKSORT are tailored to certain
types of data.  Although the QUICKSORT may appear (especially with this
program) to always be the fastest routine, this is not the case.  The
QUICKSORT is best suited to large amounts of data that are thoroughly mixed
and far from the sorted condition.  The closer the data is to being in the
sorted condition, the more efficient the SHELLSORT becomes.  In fact, for data
that is near the sorted condition, the SHELLSORT is faster than the QUICKSORT.

   Remember that these aren't the only sort routines out there, and another
that isn't in this program might suit your needs better!
