Need help regarding creation of binary tree

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

Post Reply
prashu09
Forum Newbie
Posts: 1
Joined: Tue Jun 16, 2009 7:47 am

Need help regarding creation of binary tree

Post by prashu09 »

I have to create a binary tree which will me automatically maintained when ever a new user is added.
suppose A is the top node. he adds two L1 as left and R1 as right.
after this level, the next user is added under L2 by A. if L2 has already added in his left of L1 then A can add in right of L2 as L2R2.
similarly this concept is maintained for each user under the top. Any uesr can add under his and the tree is changed for his lower ones.
Kindly help me to automatic gerneration of tree.
Post Reply