You are viewing a single comment's thread. Return to all comments →
JAVA
void decode(String s, Node root) { Node current = root; for (char c : s.toCharArray()) { if (c == '0') { current = current.left; } else { current = current.right; } if (current != null && current.data != '\0') { System.out.print(current.data); current = 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 →
JAVA