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

This commit is contained in:
Arina Dohadailo 2026-11-12 22:43:44 +00:00
parent c7d7dc0620
commit dcb5665c0e

View File

@ -27,6 +27,8 @@ class HuffmanTree:
while len(nodes) > 1:
first = 0
second = 1
if nodes[first].frequency > nodes[second].frequency:
first, second = second, first
for i in range(2, len(nodes)):
if nodes[i].frequency < nodes[first].frequency: