bones7456

Results 1 issues of bones7456

快速排序的精髓在于“减少swap的次数”,目前的实现代码中,swap次数偏多,不够精简,在GIF动图的演示里也能看出问题。 正确的实现方式可以参考[wikipedia](https://zh.wikipedia.org/zh-sg/快速排序),以下是python实现方式的代码: ```python def quickSort(arr, left=None, right=None): left = 0 if not isinstance(left,(int, float)) else left right = len(arr)-1 if not isinstance(right,(int, float)) else right if left < right: partitionIndex...