package secondChapter; import java.util.Random; public class HeapSort { private static int AHeapSize; public static void main(String[] args) { HeapSort hs = new HeapSort(); int[] A = new int[10]; //产生随机数组 for(int i=0;i<A.length;i++){ A[i] = hs.genera…