import java.util.HashMap; import java.util.Map; import java.util.ArrayList; public class Node { private Node left; private Node right; private int anzahl; private Character buchstabe; public Node() { } public Node(Node left, Node right) { this.left = left; this.right = right; } public Node getLeft() { return left; } public Node getRight() { return right; } public void setLeft(Node left) { this.left = left; } public void setRight(Node right) { this.right = right; } public int getAnzahl() { return anzahl; } public Character getBuchstabe() { return buchstabe; } public void setAnzahl(int anzahl) { this.anzahl = anzahl; } public void setBuchstabe(Character buchstabe) { this.buchstabe = buchstabe; } public static Node erstellen(Map häufigkeiten) { ArrayList nodes = new ArrayList(); for (Map.Entry entry : häufigkeiten.entrySet()) { Character character = entry.getKey(); int anzahl = entry.getValue(); } while (nodes.size() > 1) { Node min1 = nodes.get(1); for (Node node : nodes) { //if(node.getCount() < min1.getCount()) } } return null; } }