Modifications apportés

This commit is contained in:
ANHDIRE
2026-01-03 13:08:16 +01:00
parent bceb70c052
commit 5cd5f4c044
34 changed files with 2566 additions and 2519 deletions
@@ -0,0 +1,19 @@
package fr.iutfbleau.sae.mhuffman;
import java.util.Comparator;
import java.util.Map;
public class ComparateurCanonique implements Comparator<Map.Entry<Integer, String>> {
@Override
public int compare(Map.Entry<Integer, String> entree1,Map.Entry<Integer, String> entree2) {
int longueur1 = entree1.getValue().length();
int longueur2 = entree2.getValue().length();
if (longueur1 != longueur2) {
return longueur1 - longueur2;
}
return entree1.getKey() - entree2.getKey();
}
}