歸并排序
摘要:
#include<iostream>using namespace std;const int SIZE = 100;int arr[SIZE];void mergeSort(int fir,int end){ //當子序列就只有一個元素的時候就彈出 if(fir==end)return; //分治 int mid = (fir+end)/2; mergeSort(fir,mid); mergeSort(mid+1,end); //合并 int tempArr[SIZE]; int fir1=fir,fir2=mid+1; for(int i=fir;i<=end;i++) 閱讀全文
posted @ 2011-10-14 13:19 More study needed. 閱讀(177) 評論(0) 推薦(0)
浙公網(wǎng)安備 33010602011771號