Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how do I sort this 2-D array?

807569Jun 22 2006 — edited Jun 22 2006
Hi there,

I have a two-dimensional array that I'm trying to sort by a particular column, but for any given element in a column, I want it's corresponding row elements to go with it when it moves...for example:

[1,36,76,9]
[2,98,45,6]
[3,87,32,14]
[4,34,12,5]
[5,56,27,23]

Now, I want the above array to look like this:

[4,34,12,5]
[1,36,76,9]
[5,56,27,23]
[3,87,32,14]
[2,98,45,6]

Any ideas? I'm quite new and this problem is plaguing me and has been holding me back for some time now.

Thanks,

jjmclell
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2006
Added on Jun 22 2006
3 comments
185 views