How can we sort the map with value? Generally maps are sorted by key but i need map to be sorted by value. How comparator can be used to do such thing.
You cant do that.
Maps are sorted only by the index and max you can declare your own comparison function for sorting and that too only using the index.
You cant do that.
Maps are sorted only by the index and max you can declare your own comparison function for sorting and that too only using the index.
raghu
But how this is possible since comparator function is written on the basis of key. How can we write for value?
Comment