deno.land / x / masx200_leetcode_test@10.6.5 / maximum-binary-tree-ii / index.go

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package index
import serialize_and_deserialize_binary_tree "github.com/masx200/leetcode-test/serialize-and-deserialize-binary-tree"
type TreeNode = serialize_and_deserialize_binary_tree.TreeNode
func insertIntoMaxTree(root *TreeNode, val int) *TreeNode { if root == nil || root.Val < val { return &TreeNode{Val: val, Left: root}
}
root.Right = insertIntoMaxTree(root.Right, val) return root}
masx200_leetcode_test

Version Info

Tagged at
a year ago