高效算法——06哈夫曼编码(Python)

06哈夫曼编码   复杂度: O(nlogn)算法 算法: app #coding=utf-8 """ 算法:哈夫曼编码 做者:lph-China 时间:2019/7/15 """ def huffman(freq): h = [] for a in freq: heappush(h, (freq[a], a)) while len(h)
相关文章
相关标签/搜索