diff --git a/codes/guqi123/15821287.java b/codes/guqi123/15821287.java new file mode 100644 index 0000000000000000000000000000000000000000..24f513b3219ac31ac3dcffe774647aa7bfdac254 --- /dev/null +++ b/codes/guqi123/15821287.java @@ -0,0 +1,11 @@ +public static void bubbleSort(int [] a, int n){ + for (int i = 0; i < n - 1; i++) { + for (int j = 0; j < n - 1 - i; j++) { + if (a[j] > a[j + 1]) { + int temp = a[j]; + a[j] = a[j + 1]; + a[j + 1] = temp; + } + } + } +}