// check lower level nodes
// hasChild: whether a child node exists
// missingChild: whether there should be child nodes, but it is not in this list (for example,
//               the node generated by the proof is not all nodes)
check lower level nodes
hasChild: whether a child node exists
missingChild: whether there should be child nodes, but it is not in this list (for example,
the node generated by the proof is not all nodes)
// check lower level nodes // hasChild : whether a child node exists // missingChild : whether there should be child nodes but it is not in this list ( for example // the node generated by the proof is not all nodes )
func (n *TreeNode) checkChildren() (hasChild bool, missingChild bool, lastChild int) {
	alreadyNil := false
	lastChild = -1
	for i := 0; i < childrenLength; i++ {
		if n.Children[i] != nil {
			hasChild = true
			lastChild = i
			if alreadyNil {
				missingChild = true
			}
		} else {
			alreadyNil = true
		}
	}
	return
}
func ( n * TreeNode ) checkChildren ( ) ( hasChild bool , missingChild bool , lastChild int ) { alreadyNil := false lastChild = - 1 for i := 0 ; i < childrenLength ; i ++ { if n . Children [ i ] != nil { hasChild = true lastChild = i if alreadyNil { missingChild = true } } else { alreadyNil = true } } return }
check lower level nodes
hasChild: whether a child node exists
missingChild: whether there should be child nodes, but it is not in this list (for example,
the node generated by the proof is not all nodes)
check lower level nodes hasChild : whether a child node exists missingChild : whether there should be child nodes but it is not in this list ( for example the node generated by the proof is not all nodes )