update at 2020-11-08 22:26:17 by ehlxr

This commit is contained in:
ehlxr 2020-11-08 22:26:17 +08:00
parent ba516d78fc
commit 9be5ce34d7

View File

@ -53,7 +53,7 @@ public class HeapSort {
public static void sort(int[] arr) {
// 1. 将无序序列构建为一个堆
for (int i = arr.length / 2 - 1; i >= 0; i--) {
// 一个非叶子结点从下至上从右至左调整结构
// 最后一个非叶子结点从下至上从右至左调整结构
adjustHeap(arr, i, arr.length);
}
System.out.println("max heap: " + Arrays.toString(arr));