Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. void  BuildTableStr(Node * root){
  2.  
  3.  
  4.           if (root->left!=NULL){
  5.                 shCode.push_back("0");
  6.                 BuildTableStr(root->left);
  7.                   }
  8.           if (root->right!=NULL){
  9.                       shCode.push_back("1");
  10.                       BuildTableStr(root->right);
  11.                   }
  12.           if(root->left==NULL && root->right == NULL) strTable[root->ch] = shCode;
  13.  
  14.           if (shCode.size () > 0)  shCode.resize (shCode.size () - 1);
  15.               }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement