mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
添加 二叉树:以为使用了递归,其实还隐藏着回溯 go版本
添加 二叉树:以为使用了递归,其实还隐藏着回溯 go版本
This commit is contained in:
@ -336,6 +336,7 @@ class Solution:
|
||||
```
|
||||
|
||||
Go:
|
||||
|
||||
100.相同的树
|
||||
```go
|
||||
/**
|
||||
@ -351,7 +352,6 @@ func isSameTree(p *TreeNode, q *TreeNode) bool {
|
||||
case p == nil && q == nil:
|
||||
return true
|
||||
case p == nil || q == nil:
|
||||
fmt.Println(p,q)
|
||||
fallthrough
|
||||
case p.Val != q.Val:
|
||||
return false
|
||||
|
Reference in New Issue
Block a user