ITeye博客

冒泡排序

sunwch · 2010-05-18 13:21 · javase · 编程语言 · Markdown

private static int bubbleSort(int a){ for(int k=0;k<a.length;k++){ for(int i=0;i<a.length;i++){ if(a < a*){ int temp = 0; temp = a*; a* = a; a = temp; } } } return a; } 其数据项移动次数为(n*(n-1)/2)

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。