If we have a 2D int array that looks like this:
6 | 8 | 9 | 16
0 | 6 |-3 | 4
18| 2 | 1 | 11
Than the expected output would be:
0 | 2 |-3 | 4
6 | 6 | 1 | 11
18| 8 | 9 | 16
I block when when i think of it how to sort vertically.
int[][] array = new int[10][10];
for(int i = 0; i < array.length; i++){
for(int j = 0; j < array[0]; j++){
//here i block because i don't know how i would vertically sort them
}
}
I know there are a lot of topics about this and in all of them not one of them worked for me. Therefore I apologize for this post but I am stuck.
Arrays.sort(array, begin, end)