Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lesson 8 completed finally #1278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Karadesh
Copy link

Сделано: алгоритм Хаффмана через очереди (В том числе декодер). На выходе получаем закодированную строку.

#Словарь из символов и количества вхождений
def huffman_code(data):
freqTable = {}
nodeList = []
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

допустим ли такой стиль по пеп-8??

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

он недопустим

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Спасибо! Да, нужно было через нижнее подчеркивание (а лучше - максимально упрощенно, одним словом), а не CamelCase. Теперь не перепутаю.

nodeList.append(nn);
que.put(nodeList[-1])

def bl(p, codestr=[]):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

такие имена ф-ций - шифрокоддругие разработчики не поймут что делает ф-ция
нужны информативные имена

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

такие имена ф-ций - шифрокоддругие разработчики не поймут что делает ф-ция
нужны информативные имена

Спасибо! Согласен, нужно было это учитывать.

for i in user_input:
huff_list.append(i)
huff_code = huffman_code(huff_list)
print(huff_code)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет решения второй задачи

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants