You are viewing a single comment's thread. Return to all comments →
def decodeHuff(root, s): char_list = [] curr_node = root for digit in s: curr_node = curr_node.left if digit == '0' else curr_node.right if curr_node.left is None and curr_node.right is None: char_list.append(curr_node.data) curr_node = root print(''.join(char_list))
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 →