Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
HomeOffice

Mustafa Yousef musti2304

🎯
HomeOffice
  • artegic AG
  • Bonn
View GitHub Profile
@musti2304
musti2304 / SortTwoDimensionalArray.java
Created May 3, 2017
Sort the numbers within the array of a two dimensional array
View SortTwoDimensionalArray.java
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);
}
}
}