The Matrix before sorting 1st row is: 3 5 1 4 8 6 7 2 9 The Matrix after sorting 1st row is: 1 3 5 4 8 6 7 2 9