afterward

导航

 

2012年8月10日

摘要: 求排序的数最少的交换次数。只能相邻的交换。归并排序算法:View Code #include<stdio.h>#include<limits.h>const int MAXN = 500000 + 10;const int INF = INT_MAX;long long tot;//tot为逆序数总数。int arr[MAXN];//将b数组中的元素复制到a数组中。void CopyArray(int a[], int b[], int len, int left){ for(int i = 0; i < len; i++) { a[left++] = b[i]; 阅读全文
posted @ 2012-08-10 12:39 afterward 阅读(245) 评论(0) 推荐(0)