2012年2月20日

冒泡排序算法

摘要: 1 #include <stdio.h> 2 void bubble_sort(int a[], int n) 3 { 4 int i, j; 5 int tmp = 0; 6 for (i = n-1; i > 0; i--) 7 for (j = 0; j < i; j++) 8 if (a[j] > a[j+1]) 9 {10 tmp = a[j];11 a[j] = a[j+1];12 a[j+1] =... 阅读全文

posted @ 2012-02-20 14:49 快跑蜗牛 阅读(185) 评论(0) 推荐(0) 编辑

导航