输入前序 package main import ( "fmt" "strconv" "strings" ) // 定义树节点结构 type TreeNode struct { val int left *TreeNode right *TreeNode } // 构建二叉树 func buildTree(values []string) (*TreeNode, int) { if len(values) == 0 || values[0] == "null" { return nil, 1 } val, _ :=...