mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 01:56:30 +08:00
Fix the driver code of quick_sort.cpp (#1219)
This commit is contained in:
parent
07f7eb12ff
commit
d8cae21da3
1 changed files with 2 additions and 2 deletions
|
@ -154,13 +154,13 @@ int main() {
|
||||||
vector<int> nums1 = {2, 4, 1, 0, 3, 5};
|
vector<int> nums1 = {2, 4, 1, 0, 3, 5};
|
||||||
QuickSortMedian::quickSort(nums1, 0, nums1.size() - 1);
|
QuickSortMedian::quickSort(nums1, 0, nums1.size() - 1);
|
||||||
cout << "快速排序(中位基准数优化)完成后 nums = ";
|
cout << "快速排序(中位基准数优化)完成后 nums = ";
|
||||||
printVector(nums);
|
printVector(nums1);
|
||||||
|
|
||||||
/* 快速排序(尾递归优化) */
|
/* 快速排序(尾递归优化) */
|
||||||
vector<int> nums2 = {2, 4, 1, 0, 3, 5};
|
vector<int> nums2 = {2, 4, 1, 0, 3, 5};
|
||||||
QuickSortTailCall::quickSort(nums2, 0, nums2.size() - 1);
|
QuickSortTailCall::quickSort(nums2, 0, nums2.size() - 1);
|
||||||
cout << "快速排序(尾递归优化)完成后 nums = ";
|
cout << "快速排序(尾递归优化)完成后 nums = ";
|
||||||
printVector(nums);
|
printVector(nums2);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue