Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the driver code of quick_sort.cpp #1219

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions codes/cpp/chapter_sorting/quick_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ int main() {
vector<int> nums1 = {2, 4, 1, 0, 3, 5};
QuickSortMedian::quickSort(nums1, 0, nums1.size() - 1);
cout << "快速排序(中位基准数优化)完成后 nums = ";
printVector(nums);
printVector(nums1);

/* 快速排序(尾递归优化) */
vector<int> nums2 = {2, 4, 1, 0, 3, 5};
QuickSortTailCall::quickSort(nums2, 0, nums2.size() - 1);
cout << "快速排序(尾递归优化)完成后 nums = ";
printVector(nums);
printVector(nums2);

return 0;
}