java数据结构和算法------冒泡排序

 1 package iYou.neugle.sort;
 2 
 3 public class Bubble_sort {
 4     public static void BubbleSort(double[] array) {
 5         for (int i = 0; i < array.length - 1; i++) {
 6             for (int j = array.length - 1; j > i; j--) {
 7                 if (array[j] < array[j - 1]) {
 8                     double tempData = array[j];
 9                     array[j] = array[j - 1];
10                     array[j - 1] = tempData;
11                 }
12             }
13         }
14     }
15 }
原文地址:https://www.cnblogs.com/niuxiaoha/p/3951403.html