I have a hashmap set containing ::
<Key,value>
<3,a>
<5,s>
<1,r>
<0,y>
<2,k>
<4,l>
I want a result like:
<Key,value>
<3,a,y,r,k>
<5,s,y,r,k,a,l>
<1,r,y>
<0,y>
<2,k,y,r>
<4,la,y,r,k>
i.e everything is incremental....here values taken are
string(to show)....but can be any objects
for example we take 0 since all other key are greater than it , hence no values except its own are added to it...
and in case of 5 (being the highest), all the values are added including its own.
how to accomplish this task using HashMap??
i am new to
java and hashmap set.....can someone help me!!