I about data structures (trees) in java

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
JoAuSc
Messages
197
Reaction score
1
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?
 
Physics news on Phys.org