You are viewing a single comment's thread. Return to all comments →
def decodeHuff(root, s): curr = root for char in s: if char == '1': curr = curr.right elif char == '0': curr = curr.left if curr.right is None and curr.left is None: print(curr.data, end='') curr = 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 →