Here you can find the source of bubbleSort(int[] a)
public static void bubbleSort(int[] a)
//package com.java2s; //License from project: Apache License public class Main { public static void bubbleSort(int[] a) { for (int i = 0; i < a.length - 1; i++) { for (int j = 0; j < a.length - i - 1; j++) { if (a[j] > a[j + 1]) { int temp = a[j]; a[j] = a[j + 1];//from ww w. ja v a2 s . c o m a[j + 1] = temp; } } } } }