please help.. how to program nodes(like in binary tree) the root node is (1) then left(LNode) is (2) and right(RNode) is (3).. then for (2)- LNode of (4) RNode (5).. for 3-- LNode(6) RNode(7)..so on.. how can i do that.. then the numbers are in the database.. Thanx

4 Years
Discussion Span
Last Post by bLuEmEzzy

This sounds like an interesting application. I just need some clarification... We're both in the same car, I just want to know where what road we're on, and if the road leads to green pastures :-).

From what I am getting, the root node determins the LNode and RNode:

   2    1    3
   4    2    5
   6    3    7
   8    4    9

If that is the case, I would multiple the root by 2 this will give you LNode, then add one to get the value of RNode.

Private Sub CalculateNodes(root As Integer)
    ' declare the nodes
    Dim LNode, RNode as Integer

    'assign the nodes
    LNode = root * 2
    RNode = LNode + 1
End Sub

thank you for the idea. I will contact you for progress thank you so much.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.