摘要: 今天写的是归并排序,废话不多说了,贴上代码。来自于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]); } ... 阅读全文
posted @ 2011-11-20 02:49 Fooving 阅读(1071) 评论(0) 推荐(0)