Check The Programming Section
A 2-d array can be sorted either row wise or column wise. Click the below link to get the code and the process
To sort a 2-d array or a matrix completely we can follow the algorithm mentioned below:
Initialise a 2-d array
Create a 1-d array with size m X n. m is the number rows and n is the number of columns in 2-d array, created in step -1
Now copy the items of 2-d array to newly created 1-d array in step -2. This copy operation need to performed row wise
Apply any sorting algorithm over the 1-d array
Now copy back the sorted 1-d array to 2-d array and placed the item row wise
Print the 2-d array