Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

# Urgent - Array

Posted on 2006-05-19
Medium Priority
194 Views
Last Modified: 2010-03-31
Hi,

I have a 2 d array which has the values.

How do i sort the values starting from the lowest to the highest...
score[years][iterations]

the values in years 0 needs to be resorted from the lowest to highest
so does, year 1 ,pls hlep

Iterations 1   Iteratons 2   Iterations 3
Years   0       2.666667       2.66667         2.66667
Years   1       3.2224           3.2221          3.4
Years   2         3.7           3.8            3.9
Years   3       3.9            4.2               2.7
0
Question by:Jasbir21
• 2
• 2
4 Comments

LVL 92

Accepted Solution

objects earned 400 total points
ID: 16715902
Sort each row in your array:

for (int i=0; i<score.length; i++)
{
Arrays.sort(score[i]);
}
0

Author Comment

ID: 16715928
is there a way of putting it into a list and then sort the list ?

something like maps ...
0

LVL 92

Expert Comment

ID: 16715946
whats your desired result?
0

Author Comment

ID: 16723903
sorry..just saw this...actually, i used maps before, i thought to sort, need list ..
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
###### Suggested Courses
Course of the Month15 days, 17 hours left to enroll

#### 581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.