Обновить u9/huffman_tree.py

This commit is contained in:
Arina Dohadailo 2026-11-12 22:48:40 +00:00
parent 14a6744fd0
commit caba5f1d5a

View File

@ -37,15 +37,15 @@ class HuffmanTree:
elif nodes[i].frequency < nodes[second].frequency:
second = i
left = nodes[first]
right = nodes[second]
left = nodes[first]
right = nodes[second]
new_node = HuffmanNode(
None,
left.frequency + right.frequency,
left,
right
)
new_node = HuffmanNode(
None,
left.frequency + right.frequency,
left,
right
)
nodes.remove(left)
nodes.remove(right)