码迷,mamicode.com
首页 > 编程语言 > 详细

冒泡排序

时间:2015-07-17 20:43:56      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:

  1. #ifndef BUBBLING_INSERT_H[
  2. #define BUBBLING_INSERT_H
  3. void bubblingInsert(int *arr,int Length);
  4. void bubblingInsert(int *arr,int Length){
  5. int temp;
  6. for(int i=0;i<Length ;i++){
  7. for(int j=0;j<Length-1-i; j++){
  8. if(arr[j]>arr[j+1]){
  9. temp=arr[j];
  10. arr[j]=arr[j+1];
  11. arr[j+1]=temp;
  12. }
  13. }
  14. }
  15. }
  16. #endif





冒泡排序

标签:

原文地址:http://www.cnblogs.com/yml435/p/4655551.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!