You are viewing a single comment's thread. Return to all comments →
void print(node * roott, string s, int i){ node * root = roott; while(i<s.length() && (root->left!=NULL || root->right!=NULL)){ if(s[i] == '0'){ root = root->left; ++i; } else { root = root->right; ++i; } } cout<<root->data; if (i == (s.length())) { return; } else { print(roott, s, i); } } void decode_huff(node * root, string s) { print(root, s, 0); }
How can I improve my code.
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 →
How can I improve my code.