Most frequent k chars distance: Difference between revisions

Content added Content deleted
m (→‎{{header|Java}}: improved)
Line 187: Line 187:
* @return sorted HashMap
* @return sorted HashMap
*/
*/
private static <K, V extends Comparable<? super V>> HashMap<K, V>
private static <K, V extends Comparable<? super V>>
descendingSortByValues(HashMap<K, V> map) {
HashMap<K, V> descendingSortByValues(HashMap<K, V> map) {
List<Map.Entry<K, V>> list = new ArrayList<Map.Entry<K, V>>(map.entrySet());
List<Map.Entry<K, V>> list = new ArrayList<Map.Entry<K, V>>(map.entrySet());
// Defined Custom Comparator here
// Defined Custom Comparator here