2016年12月5日

归并排序

摘要: /* * 归并排序是稳定的 最好 最坏 平均情况时间复杂度都为O(log n) 空间复杂度为O(n) 在外排序中有着很好的应用。 * 下面这个是递归的版本 */ #include "iostream" using namespace std; void merge(int a[],int temp[],int left,int right,int rightEnd) { /* 合并2个有序的... 阅读全文

posted @ 2016-12-05 18:14 于无声出听惊雷 阅读(243) 评论(0) 推荐(0)

导航