huffman.py
def make_tree(freq_table):
    """
    Constructs and returns the Huffman tree from the given frequency table.
    """

    trees = BinaryHeap()
    trees.insert(TreeLeaf(None), 1)
    for (symbol, freq) in freq_table.items():
        trees.insert(TreeLeaf(symbol), freq)

    while len(trees) > 1:
        right, rfreq = trees.popmin()
        left, lfreq = trees.popmin()
        trees.insert(TreeBranch(left, right), lfreq+rfreq)

    tree, _ = trees.popmin()
    return tree

    Constructs and returns the Huffman tree from the given frequency table.
    
Constructs and returns the Huffman tree from the given frequency table.
Constructs and returns the Huffman tree from the given frequency table .
def make_tree(freq_table):
    trees = BinaryHeap()
    trees.insert(TreeLeaf(None), 1)
    for (symbol, freq) in freq_table.items():
        trees.insert(TreeLeaf(symbol), freq)
    while len(trees) > 1:
        right, rfreq = trees.popmin()
        left, lfreq = trees.popmin()
        trees.insert(TreeBranch(left, right), lfreq+rfreq)
    tree, _ = trees.popmin()
    return tree
def make_tree ( freq_table ) : trees = BinaryHeap ( ) trees . insert ( TreeLeaf ( None ) , 1 ) for ( symbol , freq ) in freq_table . items ( ) : trees . insert ( TreeLeaf ( symbol ) , freq ) while len ( trees ) > 1 : right , rfreq = trees . popmin ( ) left , lfreq = trees . popmin ( ) trees . insert ( TreeBranch ( left , right ) , lfreq + rfreq ) tree , _ = trees . popmin ( ) return tree
Constructs and returns the Huffman tree from the given frequency table.
Constructs and returns the Huffman tree from the given frequency table .
"""
    Constructs and returns the Huffman tree from the given frequency table.
    """
freq_table