摘要:今天写的是归并排序,废话不多说了,贴上代码。来自于Introduction to Algorithms。void MergeSort(int * x, int n){ M_Sort(x, 0, n - 1);}void M_Sort(int * x, int left, int right){//the real MergeSort int middle = 0; if ( right - left == 1){ if ( x[left] > x[right] ) Exchange(x[left], x[right]); } ...
阅读全文