How to write narray Tree? example pls

Discussion in 'Java' started by sanny.h@gmail.com, Dec 28, 2005.

  1. Guest

    Hi all,
    Thank you all for having this group.
    I am new to the world of java.
    I want to write a java program were the strings are stored in a
    tree (not binary tree).
    For example
    1) "APPLE" -> "RED"
    2) "APPLE" -> "WHITE"
    3) "APPLE" -> "USA" ->"RED"
    4)"APPLE" -> "USA" -> "WHITE"
    5) "APPLE" -> "USA" -> "NYC" -> "RED" ............soon

    So APPLE will have 3 child nodes (RED,WHITE,USA). Child node USA will
    have 3 child nodes (RED,WHITE,NYC) , NYC has RED ......soon.

    If not tree any other method that i can achieve this?

    Thanks in advance.
    sanny.
     
    , Dec 28, 2005
    #1
    1. Advertising

  2. > Thank you all for having this group.
    > I am new to the world of java.
    > I want to write a java program were the strings are stored in a
    > tree (not binary tree).
    > For example
    > 1) "APPLE" -> "RED"
    > 2) "APPLE" -> "WHITE"
    > 3) "APPLE" -> "USA" ->"RED"
    > 4)"APPLE" -> "USA" -> "WHITE"
    > 5) "APPLE" -> "USA" -> "NYC" -> "RED" ............soon
    >
    > So APPLE will have 3 child nodes (RED,WHITE,USA). Child node USA will
    > have 3 child nodes (RED,WHITE,NYC) , NYC has RED ......soon.
    >
    > If not tree any other method that i can achieve this?


    see TreeModel, DefaultTreeModel and JTree

    --
    Andrey Kuznetsov
    http://uio.imagero.com Unified I/O for Java
    http://reader.imagero.com Java image reader
    http://jgui.imagero.com Java GUI components and utilities
     
    Andrey Kuznetsov, Dec 28, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. adam
    Replies:
    0
    Views:
    329
  2. Dirk Vanhaute
    Replies:
    10
    Views:
    2,872
    Dirk Vanhaute
    Oct 22, 2004
  3. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,183
  4. ara howard
    Replies:
    0
    Views:
    237
    ara howard
    Oct 28, 2003
  5. Mark

    pls advise on AVL tree

    Mark, Mar 29, 2012, in forum: C Programming
    Replies:
    1
    Views:
    342
    Jorgen Grahn
    Mar 30, 2012
Loading...

Share This Page