Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void printPaths(TreeNode* node, std::string currPath) {
- if (node->left!=NULL) printPaths(node->left,currPath + '0');
- if (node->right!=NULL) printPaths(node->right,currPath + '1');
- if (node->left==NULL && node->right==NULL) {
- cout << node->charc.c << '=' << currPath << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement