C
cgirl
I am trying to determing if a n-ary tree is balanced or not, I have
been stuck trying several approaches and am getting nowhere. My new
thought is that i will have to step through each node of the tree, and
compare the lengths of the roots of the children, making sure there is
not a difference greater than one in the values for all of the
children. Am i thinking in the right direction, or is there a simpler
solution?
thanks,
kim
been stuck trying several approaches and am getting nowhere. My new
thought is that i will have to step through each node of the tree, and
compare the lengths of the roots of the children, making sure there is
not a difference greater than one in the values for all of the
children. Am i thinking in the right direction, or is there a simpler
solution?
thanks,
kim