I wrote a selection sort algorithm that sorts a one dimensional array(code below)...It works fine.

I would like to know can I use it on a two dimensional array?....Use selection sort algorithm to sort numbers in a two dimensional array.

Example: Random Numbers

6 8 4 11 15

5 2 7 9 10

13 14 12 1 3

Result should be:

sorted

1 2 3 4 5

6 7 8 9 10

11 12 13 14 15

private void SelectionSort(int[] LocalList) { for (int i = 0; i < LocalList.GetUpperBound(0); i++) { int minValue = i; for (int j = i + 1; j < LocalList.GetUpperBound(0); j++) { if (LocalList[j] < LocalList[minValue]) { minValue = j; } if (minValue != i) { SelectionSwap(LocalList, i, minValue); } } }

private void SwapFunction(int[] LocalList, int value, int minIndex) { int tempValue = LocalList[value]; LocalList[value] = LocalList[minIndex]; LocalList[minIndex] = tempValue; }

Thanks