You are viewing a single comment's thread. Return to all comments →
def decodeHuff(root, s): curr_node = root for bit in s: if bit == '1': curr_node = curr_node.right elif bit == '0': curr_node = curr_node.left if not curr_node.right and not curr_node.left: print(curr_node.data, end='') curr_node = root
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Huffman Decoding
You are viewing a single comment's thread. Return to all comments →