编程实现一个冒泡排序算法?

int [] array = new int [*] ;

int temp = 0 ;

for (int i = 0 ; i < array.Length - 1 ; i++)

{

for (int j = i + 1 ; j < array.Length ; j++)

{

if (array[j] < array[i])

{

temp = array[i] ;

array[i] = array[j] ;

array[j] = temp ;

}

}

}

posted on 2009-09-06 22:55  天清地宁  阅读(739)  评论(0编辑  收藏  举报