• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting Decending from a TreeMap  RSS feed

 
Derek McDonald
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, i've spent a few hours on this and i can't seem to find a way to get around it.

I have a treemap with names as the key and distances as values. I want to be able to get the values in decending order (biggest to smallest). I don't want to place the distances in the key becasue there may be different names that go the same distance.

Thanks in advance for your help.

Derek McDonald
 
Petr Blahos
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well this is not exactly java related, but anyway. What about
putting pairs in a list and sorting them by the distance? That
should work.

Best regards,
Petr
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!