Find Leaf Node in Binary Tree

10 views
Skip to first unread message

pedro...@akayou.com.br

unread,
Oct 1, 2013, 10:49:36 AM10/1/13
to ngeneri...@googlegroups.com

How would I go about finding a leaf node to allocate a new node in a binary tree, such as:

var subTree = new NGenerics.DataStructures.Trees.BinaryTree<int>(2);

if (!parentTree.IsFull)
{
    // goes directly under
    parentTree.Add(consTree);
}
else
{
    // find the next leaf node under this tree
    //parentTree.BreadthFirstTraversal(
    //parentTree.FindNode(
}

It seems FindNode() iterates over the entities and not the nodes itself?

Reply all
Reply to author
Forward
0 new messages