HeapSort 1.7 build: 9172 released: 2008-01-01 Williams and Floyd's TopDown HeapSort. Copyright (c) 2008 Canadian Mind Products. final class library. Download from http://mindprod.com/products2.html#HEAPSORT ===> Free <=== Full source included. You may even include the source code, modified or unmodified in commercial programs that you write and distribute. May be used freely for any purpose but military. For more details on this restriction, see http://mindprod.com/roedy.html#NONMILITARY If you include any Canadian Mind Products code in your own applications, your app too must be labeled non-military use only. All Java jars and source code are included. ---- Prerequisites: This program runs under any OS, (e.g. Win2K/XP/Vista/OSX/Linux/Solaris/Vista64/AIX...) so long as you have <><> Java version 1.5 <><> or later installed. See http://mindprod.com/jgloss/installingjava.html for details. ---- Installing on a PC: Download source and compiled class files to run on your own machine as a part of your own program. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. To install, extract the zip download with Winzip (or similar unzip utility) into any directory you please, often J:\ -- ticking off the "user folder names" option. ---- Installing on a MacIntosh: Use Safari to download source and compiled class files to run on your own machine as a part of your own program. Safari will automatically unpack the zip into ~/Downloads (version 10.5) [or on the Desktop (version 10.4 and earlier)]. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. You may optionally move the download tree to a permanent home. I don't have a MacIntosh, just a PC, so I can't test the programs for Mac compatibility. In theory they should work without problems, but in practice that does not always happen. If you have problems please, let me know, preferably with screenshots and complete verbatim error messages. ---- Rebuilding: The zip already contains the necessary class and jar files, so unless you modify the program, there is no need to recompile the source or rebuild the jar. Configure basedir="E:/" in rebuild.xml to the drive where your files are. Use ANT and rebuild.xml, not build.xml, to recompile and recreate the jar. ---- Use: HeapSort an implementation of Williams and Floyd's TopDown HeapSort. HeapSort is a fast internal sort written in Java that uses a sorting algorithm analogous to power struggles for higher positions in a hierarchical bureaucracy. Source provided. It is faster than QuickSort, but slower that RadixSort. It sorts using a comparison routine you provide to compare two elements to be sorted. May be freely distributed and used for any purpose except military. You can test it with: java.exe com.mindprod.heapsort.TestHeapSort The icon represents the hierarchical structure of the heap created during the sort. Version history 1.1 adds new address and phone number. 1.2 puts HeapSort into a package. 1.3 is compatible with the JDK1.2 Comparator/Comparable interface. 1998 Dec 28 1.4 made TestHeapSort part of the standard package, added note on invoking it. 1.5 uses the java.util.Comparator interface by default 1.6 2002-03-30 tidy code. 1.7 2008-01-01 add generics to Comparator