首页 > 代码库 > java算法

java算法

//冒泡排序public class Demo6 {	public static void main(String[] args) {		int []age = {1,2,36,363,56,95,12,32,1232,3263};				for (int i = 0; i < age.length; i++) {			for (int j = i+1; j <= age.length-1; j++) {				if(age[i] > age[j]){					int temp = age[i];					age[i] = age[j];					age[j] = temp;				}			}		}		System.out.println(Arrays.toString(age));	}}	//输出为:[1, 2, 12, 32, 36, 56, 95, 363, 1232, 3263]

  

 

java算法