-
Notifications
You must be signed in to change notification settings - Fork 182
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
base: master
Are you sure you want to change the base?
Conversation
#Словарь из символов и количества вхождений | ||
def huffman_code(data): | ||
freqTable = {} | ||
nodeList = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
допустим ли такой стиль по пеп-8??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
он недопустим
There was a problem hiding this comment.
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=[]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
такие имена ф-ций - шифрокоддругие разработчики не поймут что делает ф-ция
нужны информативные имена
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нет решения второй задачи
Сделано: алгоритм Хаффмана через очереди (В том числе декодер). На выходе получаем закодированную строку.