文件名称:kuaipai
介绍说明--下载内容均来自于网络,请自行研究使用
1. 按下述原则编写快排的非递归算法:
(1)一趟排序之后,若子序列已有序(无交换),则不参加排序,否则先对长度较短的子序列进行排序,且将另一子序列的上、下界入栈保存;
(2)若待排记录数?3,则不再进行分割,而是直接进行比较排序。
测试实例:{49 38 65 97 76 13 27 49 88 21 105}
-1. Prepared by the following principles of non-recursive algorithm for fast row: (1) After a trip to sort, if the sequence has been ordered (no exchange), not to participate in order, otherwise the first sub-sequence of shorter length sort, and will Another sequence of upper and lower stack saved (2) if the number of records to be ranked ? 3, then no longer be divided, but a direct comparison sort. Test Case: {49 3,865,977,613,274,988 21 105}
(1)一趟排序之后,若子序列已有序(无交换),则不参加排序,否则先对长度较短的子序列进行排序,且将另一子序列的上、下界入栈保存;
(2)若待排记录数?3,则不再进行分割,而是直接进行比较排序。
测试实例:{49 38 65 97 76 13 27 49 88 21 105}
-1. Prepared by the following principles of non-recursive algorithm for fast row: (1) After a trip to sort, if the sequence has been ordered (no exchange), not to participate in order, otherwise the first sub-sequence of shorter length sort, and will Another sequence of upper and lower stack saved (2) if the number of records to be ranked ? 3, then no longer be divided, but a direct comparison sort. Test Case: {49 3,865,977,613,274,988 21 105}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
快排.cpp