class Node: def __init__(self, data) -> None: self.left = None self.right = None self.leftweight = 0 self.rightweight = 0 self.data = data # Liste für die Knoten des Baumes anlegen nodes[] # Knoten anlegen nodes[0] = Node("Es") nodes[1] = Node("war") nodes[2] = Node("kam") # Knoten verbinden nodes[0].left = nodes[1] nodes[0].right = nodes[2] # Gewichte der Kanten setzen nodes[0].leftweight = 8 nodes[0].rightweight = 5