Results 1 to 1 of 1
Thread: building a tree
- 02-26-2010, 10:28 PM #1Member
- Join Date
- Jan 2010
- Rep Power
building a tree
I am trying to make a class to build a basic binary tree. If we have a root as item #1, the next item added (#2) would be its left child. The next item added (#3) would be placed as the right child. The method would sense there are out of options and to go to the far left and use the next depth: Item #4 would be the left child of item #2 and item #5 would be the right child of #2 as well. This would just keep continuing as items are added. Is it possible to do this?
Last edited by vendetta; 02-26-2010 at 10:32 PM.
- By Gregadeaux in forum New To JavaReplies: 0Last Post: 12-14-2009, 04:00 AM
- By jackmatt2 in forum New To JavaReplies: 0Last Post: 08-22-2009, 01:51 PM
- By itaipee in forum New To JavaReplies: 1Last Post: 07-28-2009, 07:41 PM
- By invincible_me in forum New To JavaReplies: 2Last Post: 08-12-2008, 02:44 PM
- By dc2acgsr99 in forum Java AppletsReplies: 4Last Post: 03-08-2008, 12:18 AM