lib/common/tree_utils.rb
#
# given a node returns how many children and the link to the
# children (if defined)
#
given a node returns how many children and the link to the
children (if defined)
given a node returns how many children and the link to the children ( if defined )
def _num_of_children(root)
      return [ 0, nil, nil ] if root.nil?
      n  = root.lnode.nil? ? 0 : 1
      n += root.rnode.nil? ? 0 : 1
      [n, root.lnode, root.rnode]
    end
def _num_of_children ( root ) return [ 0 , nil , nil ] if root . nil? n = root . lnode . nil? ? 0 : 1 n += root . rnode . nil? ? 0 : 1 [ n , root . lnode , root . rnode ] end
given a node returns how many children and the link to the
children (if defined)
given a node returns how many children and the link to the children ( if defined )
#
root
<not_specific>