时光飞逝~

2013年7月20日

归并排序

摘要: 1 #include "stdafx.h" 2 #include 3 //归并排序 4 5 //两个有序序列合并为一个新的有序序列 6 template 7 void Merge(T *a,int first,int mid, int last, T *p) 8 { 9 10 int i=first;11 int j = mid+1;12 int m=mid;13 int n=last;14 int k=0;15 while(ia[j]) p[k++] = a[j++];18 else p[k++] = a[i++];19... 阅读全文

posted @ 2013-07-20 01:23 时光飞逝~ 阅读(168) 评论(0) 推荐(0)