Programming Resources
For Fun and Learning
Charles Cusack
Computer Science
Hope College
main

Python
C++

JAVA


PHP
SQL
Alice

SortingDemo


Description
SortingDemo is a class that allows the user to create random arrays of different lenths, and then shows the result of either selection sort or quicksort.

The version of quicksort I implemented is slightly more efficient than the standard because instead of swappig elements, I do a strange sort of shifting. Because of this, the base case is complicated, and I am not sure it is absolutely correct. I tested it several times, but if you find that it isn't always correct, please send me the corrected version.

This applet is helpful to demostrate (in some cases poorly):

  • How to write quicksort and selection sort
  • How to write a simple java applet
  • How to use some of the simple swing components
  • How to do complicated borders
  • How to use Boxes and borders to get the look you want.