You are viewing a single comment's thread. Return to all comments →
simple python solution
def decodeHuff(root, s): node = root ans = "" for i in s: if node is None: return if i == "1": node = node.right elif i == "0": node = node.left if node.left is None and node.right is None: ans += node.data node = root print(ans)
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 →
simple python solution