You are viewing a single comment's thread. Return to all comments →
void decode_huff(node * root, string s) { node* curr = root; string print; while(!s.empty()) { if(curr->data != '\0') { print += curr->data; curr = root; continue; } if(s.front() == '0') { curr = curr->left; } else { curr = curr->right; } s.erase(0, 1); } print += curr->data; cout << print; }
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 →