// search looks for the node that have the value x or for the nodes that
// brace it. The node highest in the tree with the value x will be
// returned. All other nodes with the same value live in left subtree of
// the returned node.
search looks for the node that have the value x or for the nodes that
brace it. The node highest in the tree with the value x will be
returned. All other nodes with the same value live in left subtree of
the returned node.
// search looks for the node that have the value x or for the nodes that // brace it . The node highest in the tree with the value x will be // returned . All other nodes with the same value live in left subtree of // the returned node .
func (t *binTree) search(v uint32, x uint32) (a, b uint32) {
	a, b = null, null
	if v == null {
		return
	}
	for {
		vn := &t.node[v]
		if x <= vn.x {
			if x == vn.x {
				return v, v
			}
			b = v
			if vn.l == null {
				return
			}
			v = vn.l
		} else {
			a = v
			if vn.r == null {
				return
			}
			v = vn.r
		}
	}
}
func ( t * binTree ) search ( v uint32 , x uint32 ) ( a , b uint32 ) { a , b = null , null if v == null { return } for { vn := & t . node [ v ] if x <= vn . x { if x == vn . x { return v , v } b = v if vn . l == null { return } v = vn . l } else { a = v if vn . r == null { return } v = vn . r } } }
search looks for the node that have the value x or for the nodes that
brace it.
search looks for the node that have the value x or for the nodes that brace it .