You are viewing a single comment's thread. Return to all comments →
void decode(String s, Node root) { Node node = root; for (int i = 0; i < s.length(); i++) { node = s.charAt(i) == '0' ? node.left : node.right; if (node.left == null && node.right == null) { System.out.print(node.data); 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 →