Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I need help about data structures (trees) in java

  1. Feb 11, 2006 #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?
     
  2. jcsd
  3. Feb 11, 2006 #2

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: I need help about data structures (trees) in java
Loading...