parent
047c4db195
commit
552e24b171
|
|
@ -368,9 +368,7 @@ func invertTree(root *TreeNode) *TreeNode {
|
|||
if root ==nil{
|
||||
return nil
|
||||
}
|
||||
temp:=root.Left
|
||||
root.Left=root.Right
|
||||
root.Right=temp
|
||||
root.Left,root.Right=root.Right,root.Left//交换
|
||||
|
||||
invertTree(root.Left)
|
||||
invertTree(root.Right)
|
||||
|
|
|
|||
Loading…
Reference in New Issue