Guest User

Untitled

a guest
Jun 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. string tree2str(TreeNode* root){
  2. if(root == nullptr)
  3. return "";
  4. else
  5. return root->val + "(" + tree2str(root->left) + ")" + "(" + tree2str(root->right) + ")";
  6. }
Add Comment
Please, Sign In to add comment