From e8c8686079329898864363a530b2a883aebbb038 Mon Sep 17 00:00:00 2001 From: cy-by-side <153972766+cy-by-side@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:04:37 +0800 Subject: [PATCH] Fix the driver code of quick_sort.cpp --- codes/cpp/chapter_sorting/quick_sort.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codes/cpp/chapter_sorting/quick_sort.cpp b/codes/cpp/chapter_sorting/quick_sort.cpp index e0b48ac246..9768fec8aa 100644 --- a/codes/cpp/chapter_sorting/quick_sort.cpp +++ b/codes/cpp/chapter_sorting/quick_sort.cpp @@ -154,13 +154,13 @@ int main() { vector nums1 = {2, 4, 1, 0, 3, 5}; QuickSortMedian::quickSort(nums1, 0, nums1.size() - 1); cout << "快速排序(中位基准数优化)完成后 nums = "; - printVector(nums); + printVector(nums1); /* 快速排序(尾递归优化) */ vector nums2 = {2, 4, 1, 0, 3, 5}; QuickSortTailCall::quickSort(nums2, 0, nums2.size() - 1); cout << "快速排序(尾递归优化)完成后 nums = "; - printVector(nums); + printVector(nums2); return 0; }