一、冒泡排序;
http://v.youku.com/v_show/id_XMzMyOTAyMzQ0.html
1 //冒泡排序 2 public class Bubbling { 3 public static void main(String[] args) { 4 int[] a = {1,3,9,5,6,8,4,0,7,2}; 5 for (int i=0;i<a.length;i++) { 6 for (int j=0;j<10-i-1;j++) { 7 if(a[j] > a[j+1]) { 8 int b = a[j]; 9 a[j] = a[j+1]; 10 a[j+1] = b; 11 } 12 } 13 } 14 15 for (int i=0;i<10;i++) { 16 System.out.print(a[i] + " "); 17 } 18 19 } 20 }
二、希尔排序;
http://v.youku.com/v_show/id_XMzMyODk5MzI4.html?f=16755664
三、选择排序;
http://v.youku.com/v_show/id_XMzMyODk5MDI0.html?f=16755664
四、快速排序;
http://v.youku.com/v_show/id_XMzMyODk4NTQ4.html?f=16755664