惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
量子位
G
Google Developers Blog
J
Java Code Geeks
N
Netflix TechBlog - Medium
博客园 - 聂微东
宝玉的分享
宝玉的分享
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
雷峰网
雷峰网
M
MIT News - Artificial intelligence
T
Tailwind CSS Blog
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss

博客园 - Edward Xie

(转)听微软大牛们谈怎样成为优秀的工程师 深入探讨数据库可用性分组 google的搜索 4 fun 从‘和少妇成功上床’学习‘金融学’(转) osi tcpip (转)Google Wave从入门到进阶 google wave Nehalem thinkpad bios APS in Linux for Lenovo R61i good .net 关于DotNET的整理 幽默 思考 想整这么一套 找个地放哈备忘 UBUNTU游戏集合 mount 中文man(转) 个人收集的一些ubuntu资料 (转)aptitude
冒泡
Edward Xie · 2008-10-08 · via 博客园 - Edward Xie

 1 for (i = 0; i < scores.Length -1 ; i++)
 2 {
 3       for (j = 0; j < scores.Length -1 - i ; j++)
 4       {
 5             if (scores[j] > scores[j + 1])
 6             {
 7                   // 交换元素
 8                   temp = scores[j];
 9                   scores[j] = scores[j + 1];
10                   scores[j + 1= temp;
11             }
12       }13 }

1   3   5   7  ...       2 * i - 1                     2    4     6   8    ...   2 * i