更新时间:2023-01-11 23:29:01
问题是你要留下1个要检查的元素
只需要替换你的代码:
The problem is that you are leaving 1 element to be checked
just replace your code :
quickSort(array, start, partition - 1);
quickSort(array, partition + 1, end);
这个:
quickSort(array, start, partition - 1);
quickSort(array, partition, end);
或用此:
quickSort(array, start, partition);
quickSort(array, partition + 1, end);
我假设现在原因很清楚,但请告诉我你是否需要一些解释。
I am assuming that the reason is clear now, but tell me if you need some explanation.