From 8fe78d91d8c7b1f3ab17b7ee110944b0e3f88f66 Mon Sep 17 00:00:00 2001 From: guoqiang <1915763994@qq.com> Date: Tue, 24 Aug 2021 22:05:05 +0800 Subject: [PATCH] fix name error: adjust --- algorithm/sort.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/algorithm/sort.cpp b/algorithm/sort.cpp index 81cba7b..601bfcb 100644 --- a/algorithm/sort.cpp +++ b/algorithm/sort.cpp @@ -5,7 +5,7 @@ using namespace std; //堆排序:堆调整 -void adujust_heap(int arr[], int start, int end) { +void adjust_heap(int arr[], int start, int end) { int dad = start; int son = 2 * dad + 1; @@ -23,11 +23,11 @@ void adujust_heap(int arr[], int start, int end) { //堆排序 void heap_sort(int arr[], int len) { for (int i = len / 2 - 1; i >= 0; --i) { - adujust_heap(arr, i, len - 1); + adjust_heap(arr, i, len - 1); } for (int i = len - 1; i > 0; --i) { swap(arr[0], arr[i]); - adujust_heap(arr, 0, i - 1); + adjust_heap(arr, 0, i - 1); } }