标签:
1 public void bubbleSort(int[] nums) { 2 for (int i = 0; i < nums.length; i++) 3 for (int j = 0; j < nums.length - 1 - i; j++) { 4 if (nums[j] < nums[j + 1]) { 5 int temp = nums[j]; 6 nums[j] = nums[j + 1]; 7 nums[j + 1] = temp; 8 } 9 } 10 }
标签:
原文地址:http://www.cnblogs.com/acode/p/5796272.html