Mac hat alles gemacht

master
L 2025-03-26 11:03:10 +01:00
parent 20b276844d
commit 0e27743f78
1 changed files with 83 additions and 0 deletions

83
Node.java Normal file
View File

@ -0,0 +1,83 @@
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<Character, Integer> häufigkeiten)
{
ArrayList<Node> nodes = new ArrayList<Node>();
for (Map.Entry<Character, Integer> 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;
}
}