Sijar ahmed
Posts: 2
Nickname: sahmed
Registered: Apr, 2007
|
|
Printing a n-Nodes Tree
|
Posted: Apr 18, 2007 4:34 AM
|
|
|
Advertisement
|
I have this problem related to n-nodes Tree, I have created a n-nodes Tree as following:
class Treenode { String data; Treenode parent; List<Treenode> children = new ArrayList<Treenode>(); /** further lots of member functions */ }
I'm stuck up in the printing part of the program. Which is to be done in like this, A |---- B |.....|----F |.....|----E |...........|----H |-----C |.....|----G | |------D
Where it's obvious that A is the root, B,C & D are its children and F,G & D are leaves.
Can any body get me any logic/method to do this.
|
|