摘要:
/*PROB:barn1LANG:C++*/#include#includeusing namespace std;int partion(int arr[],int low,int high){ int pivot=arr[low]; int pivotkey=arr[low]; while(low=pivotkey) high--; arr[low]=arr[high]; while(lowarr[j]){ max=arr[i+1]; arr[i+1]=arr[j... 阅读全文
摘要:
int *space=new int[c-1];int top(int space[]){}作为函数参数传递时,如topMax(space);在topMax函数中使用space[i]可以取得space数组的所有元素值,但是不能在topMax函数中通过sizeof(space)\sizeof(space[0])来获得space数组的长度。只能把space数组的长度作为topMax()函数的参数传递进去。 阅读全文
摘要:
/*PROB:milkLANG:C++*/#include#includeusing namespace std;int partion(int arr[],int arr1[],int low,int high){ int pivot=arr[low]; int pivot1=arr1[low]; int pivotkey=arr[low]; while(low=pivotkey) high--; arr[low]=arr[high]; arr1[low]=arr1[high]; while(low>re... 阅读全文
摘要:
#includeusing namespace std;int partion(int arr[],int low,int high){ int pivot=arr[low]; int pivotkey=arr[low]; while(low=pivotkey) high--; arr[low]=arr[high]; while(low<high && arr[low]<=pivotkey) low++; arr[high]=arr[low]; } arr[low]=pivot;... 阅读全文