2014年11月28日

起泡法排序

摘要: 起泡法的思路是:将相邻的两个数比较,将小的调到前头。可以推知,如果有 n 个数,则要进行 (n-1) 轮比较和交换。在第一轮要进行 (n-1) 次两两比较,在 j 轮中要进行 (n-j) 次两两比较。下面将10个数从小到大进行排序:#includeusing namespace std;int ma... 阅读全文

posted @ 2014-11-28 13:32 humingX 阅读(1214) 评论(1) 推荐(0) 编辑

导航