归并排序
摘要:
#include<iostream.h>void Merge(int *a,int p,int q,int r)//合并一个数组中前后两个有序序列{ //p,q,r是数组下标,a[p---q],a[q+1---r]两个有序 int *pA=a+p; int *pB=a+q+1; while(pA!=pB&&pB<=a+r) { if(*pA<=*pB) pA++; else { int temp=*pB; ... 阅读全文
posted @ 2012-10-14 22:59 为梦飞翔 阅读(193) 评论(0) 推荐(0)
浙公网安备 33010602011771号