摘要:
#include using namespace std; const int MAX = 1001; int l[MAX]; //Heap Sort void HeapAdjust(int s, int m) { int rc = l[s]; for(int j=2*s;j=l[j]) break; l[s]=l[j]; s=j; }... 阅读全文
摘要:
#include using namespace std; const int MAX = 10001; int l[MAX]; int Partition(int low, int high) { l[0]=l[low]; int pivotkey=l[low]; while(low=pivotkey) high--; l[l... 阅读全文
摘要:
#include using namespace std; const int MAX = 1001; int l[MAX]; void ShellInsert(int n, int dk) { for(int i=dk+1;i0&&l[0]0;k/=2) ShellInsert(n, k); } int main() { int n; cin>>n... 阅读全文
摘要:
//直接插入排序 #include using namespace std; const int MAX = 1001; int l[MAX]; void InsertSort(int n) { int j; for(int i=2;i>n; for(int i=1;i>l[i]; InsertSort(n); for(int i=1;i<=n... 阅读全文
摘要:
Description You know sorting is very important. And this easy problem is: Given you an array with N non-negative integers which are smaller than 10,00 阅读全文