Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
example

input :

n=3

2 2 1
3 53 4
32 5 3

output:

1 2 2
3 3 54
4 32 53
_________________
C#
using System;

class Program
{
    static void Main()
    {
	int[] values = { 4, 7, 2, 0 };
	Array.Sort(values);
	foreach (int value in values)
	{
	    Console.Write(value);
	    Console.Write(' ');
	}
	Console.WriteLine();
    }
}

this code sorts one dimensional array, but how do i sort a two dimensional array (sorting columns first and then the rows)
Posted
Comments
[no name] 24-Apr-14 6:02am    
http://channel9.msdn.com/forums/Coffeehouse/189171-Sorting-Two-Dimensional-Arrays-in-C/
[no name] 24-Apr-14 6:03am    
check http://channel9.msdn.com/forums/Coffeehouse/189171-Sorting-Two-Dimensional-Arrays-in-C/

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900