From 9be5ce34d7bd375f9b7d983a2c5bc981d7e90fe8 Mon Sep 17 00:00:00 2001 From: ehlxr Date: Sun, 8 Nov 2020 22:26:17 +0800 Subject: [PATCH] update at 2020-11-08 22:26:17 by ehlxr --- src/main/java/me/ehlxr/sort/HeapSort.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/ehlxr/sort/HeapSort.java b/src/main/java/me/ehlxr/sort/HeapSort.java index 6aad702..0cd0e0b 100644 --- a/src/main/java/me/ehlxr/sort/HeapSort.java +++ b/src/main/java/me/ehlxr/sort/HeapSort.java @@ -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));