Created
June 20, 2018 11:12
-
-
Save Kishy-nivas/9ecf1c7f6eaade56737d7334ac2c41d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string tree2str(TreeNode* root){ | |
if(root == nullptr) | |
return ""; | |
else | |
return root->val + "(" + tree2str(root->left) + ")" + "(" + tree2str(root->right) + ")"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment