a*****i 发帖数: 4391 | 1 【 以下文字转载自 Programming 讨论区 】
【 原文由 ayanami 所发表 】
Supppose I have a HashMap wordmap with a String key, a integer value.
[Key=>value]
What is the easiest way to sort them based on value?
I looked at SortMap, but it only sorts based on key.
Thanks! | F****n 发帖数: 3271 | 2 What is a Hashtable? Hashtable use hashCode to index data, so you can not
"sort" the value, the only way you can do is to create another sorted list of
values.
【在 a*****i 的大作中提到】 : 【 以下文字转载自 Programming 讨论区 】 : 【 原文由 ayanami 所发表 】 : Supppose I have a HashMap wordmap with a String key, a integer value. : [Key=>value] : What is the easiest way to sort them based on value? : I looked at SortMap, but it only sorts based on key. : Thanks!
|
|