Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<bool> code;
- map<char,vector<bool> > table;
- void BuildTable(Node *root)
- {
- if (root->left!=NULL)
- { code.push_back(0);
- BuildTable(root->left);}
- if (root->right!=NULL)
- { code.push_back(1);
- BuildTable(root->right);}
- if (root->left==NULL && root->right==NULL) table[root->c]=code;
- code.pop_back();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement