网站开发与移动开发

博客园 首页 新随笔 管理

2010年4月2日 #

摘要: //交换数据void Swap(int &a, int &b){ int temp = a; a = b; b = temp;}//冒泡排序void BubbleSort(int *arr, int size){ int i, j; for(i=0;i<size-1;i++) for(j=size-1;j>i;j--) if(arr[j] < arr[j-1]) Swap(arr[j], arr[j-1]);}//选择排序void SelectionSort(int *arr, int size){ int i, j, min; //找出从a[i]到a[siz 阅读全文
posted @ 2010-04-02 08:26 txf2004 阅读(202) 评论(0) 推荐(0) 编辑