/** Source code example for "A Practical Introduction to Data Structures and Algorithm Analysis, 3rd Edition (Java)" by Clifford A. Shaffer Copyright 2008-2011 by Clifford A. Shaffer */ /** A JUnit test class for sort algorithms */ import java.io.*; public class SortTest extends junit.framework.TestCase { final static int testsize = 1000; static Integer A[]; static int THRESHOLD = 8; static > void Sort(E[] A) { heapsort(A); } static > void heapsort(E[] A) { // The heap constructor invokes the buildheap method MaxHeap H = new MaxHeap(A, A.length, A.length); for (int i=0; i