Skip to content

Instantly share code, notes, and snippets.

View musti2304's full-sized avatar

Mustafa Yousef musti2304

  • innovas GmbH
  • Bonn
View GitHub Profile
@musti2304
musti2304 / SortTwoDimensionalArray.java
Created May 3, 2017 22:17
Sort the numbers within the array of a two dimensional array
public static void bubbleSort(Integer[][] array) {
for (int i = 0; i < array.length; i++) {
for (int m = array[i].length; m >= 0; m--) {
for (int j = 0; j < array[i].length - 1; j++) {
int k = j + 1;
if (array[i][j] > array[i][k]) {
swapNumbers(i, j, k, array);
}
}
}