Sorting Arrays - help needed
I have an array of 45 different numbers and i want to put them in descending or ascending order. these are the numbers:
main```````sub
1````````````574.7
2````````````184.34
3````````````129.52
4````````````240.96
5````````````446.99
etc.
i can arrange the sub numbers in order but i want the main numbers in the same order as the sub. can anyone point me to the right method?
thnx.
i have two sets of arrays. one is in order of 1 to 45 and the other is mixed numbers but they are linked. the main and sub hasn't got anything to do with the script or anything.
i want to know how to get the right hand side numbers in any order and the left hand side numbers in the same order as what u have put the right hand side in
Java Collection framework provides us with an interface called Map. which can store elements in a key/value pair fasion.
Map interface has many implementation classes, but I think you need to use TreeMap class which sort its keys according to the natural ordering.
you can refere to docs page:
http://java.sun.com/j2se/1.5.0/docs/api/index.html