algorithm icon indicating copy to clipboard operation
algorithm copied to clipboard

algorithm/js/sort.js

Open Lianstu opened this issue 6 years ago • 1 comments

快排:空间复杂度上不需要再增加两个辅助数组;他的用到栈,空间复杂度是栈的使用次数就是递归次数,多出来的两个辅助数组浪费了; 这个版本像是尤雨溪老师的那个,只是去掉了splice()这个循环的js内部方法

Lianstu avatar May 25 '18 02:05 Lianstu

有原地快排的版本。这个快排只是作为演示,没有考虑算法的稳定性。

qieguo2016 avatar May 25 '18 03:05 qieguo2016