Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions 018-树的子结构/problem018.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func hasSub(p *TreeNode, c *TreeNode) bool {
if p == nil { return false }

if p.Val != c.Val {
return true
return false
}

return hasSub(p.Left, c.Left) && hasSub(p.Right, c.Right)
Expand All @@ -44,7 +44,4 @@ func main() {
sub3 := &TreeNode{2, nil, nil}

fmt.Println(hasSubRootOrTree(root, sub1), hasSubRootOrTree(root, sub2), hasSubRootOrTree(root, sub3))



}