PDA

View Full Version : I need help about data structures (trees) in java


JoAuSc
Feb11-06, 10:39 PM
I'm trying to create this program that allows the user to create and manipulate trees. For example, a user might create a new tree with a node containing "words" as its data, then create nodes containing "nouns", "verbs", "adjectives", etc. as their data. The problem is I don't know how to create or work with trees. Is there some kind of "Tree" object in java, where I can just write

Tree newTree = new Tree();

and manipulate the tree with methods like

newTree.addNode("nouns");

or

newString = newTree.node1.getData()

?

And if not, how would I work with trees?

Hurkyl
Feb11-06, 10:57 PM
If you don't know how to work with trees, then why do you think you need one? What are you actually trying to do?