摘要: 1.冒泡排序法: 1 //方法1--从小到大(假设有数组int array[n]) 2 void bubbleSort(int *array,int n) 3 { 4 int tmp; 5 for(int i=0;iarray[j+1]) { 8 tmp=array[j]; 9 arrar[j]=array[j+1];10 array[j+1]=tmp;11 }12 }13 }14 } 1 //方法2--从大到小 2 void bubb... 阅读全文
posted @ 2013-06-13 15:55 MingFung_Liu 阅读(180) 评论(0) 推荐(0) 编辑