快速排序算法思路步骤: 1.从一个数组中任意挑选一个元素(通常来说会选择最左边的元素)作为中轴元素,将剩下的元素以中轴元素作为比较的标准; 2.将小于等于中轴元素的放到中轴元素的左边,将大于中轴元素的放到中轴元素的右边; 3.然后以当前中轴元素的位置为界,将左半部分子数组和右半部分子数组看成两个新的数组,重复上述操作,直到子数组的元素个数小于等于1(因为只一个元素的数组必定是有序的)。
luolanjiao Goto Github PK
Name: little jiao
Type: User
Bio: To think more accurately,to do better,to live more wonderfully 让自己的思维变得更精准,让自己的习惯变得更优良,让自己的生活变得更精彩