We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
不知道是不是这个意思
// 构建树 class TreeNode { constructor (val = 0, left = null, right = null) { this.val = val this.left = left this.right = right } } function isSameTree (p, q) { if (!q && !p) { return true } if (p.left === q.left) { return true } if (p.right === q.right) { return true } return isSameTree(p.left, q.left) && isSameTree(p.right, q.right) } const tree1 = new TreeNode(1, new TreeNode(2), new TreeNode(3)); const tree2 = new TreeNode(1, new TreeNode(2), new TreeNode(3)); console.log(isSameTree(tree1, tree2))
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: