摘要: //快速排序#includevoid QuickSort(int arr[], int before, int after );int main( ){ int i; int arr[]={3,4,2,6,1,9,8,5,7,2}; int len=sizeof(arr)/sizeof(... 阅读全文
posted @ 2015-10-13 20:16 驻足一分钟 阅读(113) 评论(0) 推荐(0) 编辑
摘要: //选择排序#includevoid SelectSort(int arr[],int len);int main(void){ int i; int arr[9]={1,4,2,4,6,8,3,9,5}; int len=sizeof(arr)/sizeof(arr[0]); SelectSort... 阅读全文
posted @ 2015-10-12 21:05 驻足一分钟 阅读(128) 评论(0) 推荐(0) 编辑
摘要: //改进的冒泡程序#includevoid BubbleSort(int arr[], int length); int main( ){ int i; int arr[9] = {1,1,5,7,2,4,9,6,8}; int length=sizeof(arr)/sizeof(... 阅读全文
posted @ 2015-10-12 20:30 驻足一分钟 阅读(191) 评论(0) 推荐(0) 编辑
摘要: //希尔排序(shell排序)#includeusing namespace std;void print(int a[], int n ,int i){ cout= 1 ) { ShellInsertSort(a, n, d); d = d/2;... 阅读全文
posted @ 2015-10-12 16:26 驻足一分钟 阅读(158) 评论(0) 推荐(0) 编辑