You are viewing a single comment's thread. Return to all comments →
There is a bug, NULL (None) is represented by chr(0)
def decodeHuff(root, s): i = 0 node = root res = "" while i < len(s): while node.data == chr(0): if s[i] == '0': assert node.left node = node.left else: assert node.right node = node.right i += 1 res += node.data node = root print(res)
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 →
There is a bug, NULL (None) is represented by chr(0)