从数组中 任取一个元素 p (可随机取,现在以取第一个为例).以P作为主元,对数组 进行划分 ,前一部分小于 P,后一部分 大于p.最后划分处存储p,然后分别对...
代码说明:
从数组中 任取一个元素 p (可随机取,现在以取第一个为例).以P作为主元,对数组 进行划分 ,前一部分小于 P,后一部分 大于p.最后划分处存储p,然后分别对划分后的前一部分和后一部分递归调用. 算法平均时间复杂度: O(nlogn) -Any check from the array element p (can be random access, and now to take the first example). To P as the main element of the array to be divided, the first part is less than P, the latter part of the final division is greater than p. Department store p , and then were divided into the first part and the latter part of recursive calls. algorithm the average time complexity: O (nlogn)
下载说明:请别用迅雷下载,失败请重下,重下不扣分!