Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Sorting 2D array in java (http://www.go4expert.com/forums/sorting-2d-array-java-t9481/)

shilpa dessai 20Mar2008 14:59

Sorting 2D array in java
 
Hi, I've got a 2D array which I would like to sort into descending order according to the first column but keep the information in the 2nd column in the same row as the information in the first column no matter where the sort moves it to in the array. To explain more clearly:
Supposing I had this 2D array:

|5 1|
|6 2|
|3 3|
|8 4|
|2 5|

I want my bubble sort to be able to sort it into:

|8 4|
|6 2|
|5 1|
|3 3|
|2 5|

All the info I've found on bubble sorts has only been about 1D arrays. Any help or a nudge in the right direction would be really appreciated!
Regards
shilpa

shabbir 20Mar2008 15:38

Re: Sorting 2D array in java
 
Moved to Java forum

pradeep 20Mar2008 16:00

Re: Sorting 2D array in java
 
http://forum.java.sun.com/thread.jsp...sageID=9949148


All times are GMT +5.5. The time now is 23:54.