Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DecodeHuffmanCode(MHnode* root,string code)
- {
- int i=0;
- string res="";
- MHnode* runner=root;
- for(int i=0; i<code.length(); i++){
- runner=root;
- while(runner->left or runner->right){
- if(code[i]=='0'){
- runner=runner->left;
- }else{
- runner=runner->right;
- }
- }
- res+=runner->letter;
- }
- cout<<res<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement