You are viewing a single comment's thread. Return to all comments →
I have just copy pasted ur code except using sysout statement instead of string buffer
Node c = root; for (int i = 0; i < S.length(); i++) { c = S.charAt(i) == 1 ? c.right : c.left; if (c.left == null && c.right == null) { System.out.print(c.data); c = root; } }
But it is printing BBB for given test case which is wrong!! I am doing an overlook??
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 →
I have just copy pasted ur code except using sysout statement instead of string buffer
But it is printing BBB for given test case which is wrong!! I am doing an overlook??