Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. void printPaths(TreeNode* node, std::string currPath) {
  2.     if (node->left!=NULL) printPaths(node->left,currPath + '0');
  3.     if (node->right!=NULL) printPaths(node->right,currPath + '1');
  4.  
  5.     if (node->left==NULL && node->right==NULL) {
  6.         cout << node->charc.c << '=' << currPath << endl;
  7.     }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement