You are viewing a single comment's thread. Return to all comments →
void decode(String s, Node root) { int at = 0; Node curr = root; while(at<s.length()){ char c = s.charAt(at++); if(c=='0') curr = curr.left; else curr = curr.right; if(curr.left==null){ System.out.print(curr.data); curr = 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 →