You are viewing a single comment's thread. Return to all comments →
C++
void decode_huff(node * root, string s) { node* curr=root; for(int i=0;i<s.length();i++) { if(s[i]=='0') curr=curr->left; else curr=curr->right; if(curr->left==NULL && curr->right==NULL) { cout<<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 →
C++