i am trying to work out on a HashMap in order to pair up my values...
so its like this
this piece of code generates the first output i needed...
P1 = 2.0
P2 = 3.0
P3 = 6.0
P4 = 7.0
P5 = 8.0
P6 = 3.0
P7 = 3.0
P8 = 1.0
P9 = 2.0
P10 = 4.0
and some more lines below the code, is the Arrays.sort() to sort the values of p[]
and it gives this output...
2.0 is mapped to P9
1.0 is mapped to P8
2.0 is mapped to P9
3.0 is mapped to P7
3.0 is mapped to P7
3.0 is mapped to P7
4.0 is mapped to P10
6.0 is mapped to P3
7.0 is mapped to P4
8.0 is mapped to P5
the next output must show the sorted values on the left mapped to the same P# as it was assigned above...
but, it seems that when a value is a duplicate, it only shows 1 P# that contains the value and i want
to get the sorted value together with the assigned P#.
can you help me on this one?
i wanted to be my output like
2 is mapped to P1
1 is mapped to P8
2 is mapped to P9
3 is mapped to P2
3 is mapped to P6
3 is mapped to P7
4 is mapped to P10
6 is mapped to P3
7 is mapped to P4
8 is mapped to P5
thanks in advance...