Trees in Java

Hi All,
I am looking for ways to store data in the database in Binary Tree format and then retrieve and display the data in Tree format in JSP. There are lots of topic on JTree. But this requires the construction of Tree. I want to store the data itself as Tree and then display it. Could anyone offer help ?
Thanks in advance.

for example if i enter a new
value all i need to specify is its parent.Hi again,
hmm ... that is not the way, a binary tree works - a binary tree should garantee that both branches are of nearly equal size - that is called a balanced tree - only when it is balanced you get the efforts of binary search in the tree, good performance - find a value in less than 1+log n steps if log means the logarithmic function based on 2 ( sorry, I am German and don't know the correct english term for it) and n means the number of nodes in the tree.
So, when you insert a new value in that tree, the algorithmus chooses the place in that tree, not the user. And the tree must be rearranged to keep the balance so that the performance of that tree can be garanteed. In many cases this means that the first position of a value in the tree will be changed by the rebalancing operations needed.
Thinik this over
greetings Marsian

Similar Messages

  • Populate Flex Tree from Java Code (Database)

    Hi
    Can someone please help me? I'm very new to using flex. I'm
    basically trying to create a tree that is populated from data in my
    database. I am using hibernate to fetch that data.
    The plan is to basically create the tree in Java code (since
    I don't want any processing done on the client PC) and then pass
    this to the flex tree (or an actionscript data structure that is
    compatible as the tree datasource)
    I am creating the java tree using DocumentImpl. Is this
    correct? What class would work?
    Element e = null;
    Node n = null;
    Document xmldoc= new DocumentImpl();
    Element root = xmldoc.createElement("USERS");

    quote:
    Originally posted by:
    ntsiii
    Stop running and get a map (read the documents)
    This is hardly a useful comment and must discourage new users
    from asking questions. If you think the documentation relating to
    the use of the tree control is straightforward then I beg to
    differ.
    If you are aware of a clear example of how to use the data
    tree with a php backend returning a remote data object please
    enlighten me. Meanwhile I continue my search but not within the
    livedocs.
    One site I have found that may be of use is
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    Not everyone is an expert.

  • Creating non binary trees in Java

    Hi everybody actually i am used in creating binary trees in java,can u please tell me how do we create non binary -trees in java.

    Hi,
    Can u let us know the application area for Non binary tree.
    S Rudra

  • Non binary trees in java

    Hi guys i am used in creating binary trees ,tell me how do we create non binary trees in java.

    public class Node {
      private final Object payload;
      private final Set<Node> children;
      public Node(Object payload) {
        this.payload = payload;
        children = new HashSet<Node>();
      // now add methods to add/remove children, a method to do something with the payload (say,
      // a protected method that passes the payload to a method specified by some kind of interface),
      // and methods to recurse over children.
    }Actually rather than using Object probably should have generic-ized the class, but whatever.

  • Binary Tree in Java - ******URGENT********

    HI,
    i want to represent a binary tree in java. is there any way of doing that.
    thanx
    sraphson

    HI,
    i want to represent a binary tree in java. is there
    e any way of doing that.
    thanx
    sraphsonFirst, what is a binary tree? Do you know how the binary tree looks like on puesdo code? How about a representation in terms of numbers? What is a tree? What is binary? The reason I ask is, what do you know about programming?
    Asking to represent a binary tree in java seems like a question who doesn't know how it looks like in the first please. Believe me, I am one of them. I am not at this level yet. If you are taking a class that is teaching binary trees and you don't know how it looks like, go back to your notes.
    Sounds harsh, but it is better to hear it from a person that doesn't know either then a boss that hired you because Computer Science was what you degree said. Yet, you don't know how to program?
    Telling you will not help you learn. I can show you tutorials of trees would be start on where to learn.
    HOW TO USE TREES (oops this is too simple, but it is a good example)
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    CS312 Data Structures and Analysis of Algorithms
    (Here is a course about trees. Search and learn)
    http://www.calstatela.edu/faculty/jmiller6/cs312-winter2003/index.htm

  • Binary trees in Java

    Hi there
    Do you have any suggestions about how to implement trees or binary trees in Java?
    As far as I know there are already some libraries for that, but I don't know how to use them. Was trying to get some implementation examples but I'm still very confused.
    How can I use for example:
    removeChild(Tree t)
    addChild(Tree t)
    isLeaf()
    Thanks in advance

    Lulu wrote:
    Hi there
    I have several questions about binary trees
    Let's see, I use TreeMap to create them with the following code:
    TreeMap treeMap = new TreeMap<Integer, String>();
    treeMap.put("first", "Fruit");
    treeMap.put("second","Orange");
    treeMap.put("third", "Banana");
    treeMap.put("fourth", "Apple");You've defined the map to hold integer keys and strings as values, yet you're trying to add string keys and string values to it: that won't work.
    If this is a map how do I define if the data should go to the left or to the right of certain node?That is all done for you. In a TreeMap (using the no-args constructor), you can only store objects that are comparable to each other (so, they must implement the Comparable interface!). So the dirty work of deciding if the entry should be stored, or traversed, into the left or right subtree of a node, is all done behind the scenes.
    Also note that TreeMap is not backed up by a binary tree, or a binary search tree, but by a red-black tree. A red-black tree is a self balancing binary tree structure.
    Should I have dynamical keys so that they increase automatically when adding new data?
    According to a webpage I should use Comparator(), is that to find the data in the tree and retrieve the key?
    ThanksI am not sure what it is you want. I am under the impression that you have to write a binary tree (or a binary search tree) for a course for school/university. Is that correct? If so, then I don't think you're permitted to use a TreeMap, but you'll have to write your own classes.

  • Implementation of LISP trees in Java

    I have a problem with implementation of a something similar to a LISP tree in Java. That means that I want to be able to combine different if-else-conditions from a set of variables and operators and run it. For example, if (variable) (operator) (variable) (operator2) (variable) (operator) (variable)
    whereby :
    variable: means a variable
    operator: <, >, =, +, _,
    variable: variable
    operator2: &&, ||, etc
    I don't know how to do in a way that a variable can be picked up from a set, operator can be picked up from a set and operator2 can also be picked up from a set.

    Lisp doesn't use trees... it uses lists. In fact, Lisp stands for "List Processing".
    Take a look at the java.util.LinkedList class. If you make a LinkedList of Nodes, where each Node contains an Object car and LinkedList cdr, you've got yourself a Lisp list implementation!

  • How can I link to pages in a 2 level popup index/selection tree with java script?

    I can do a single level popup index using the java script below (#1) and link the selections to pages but to change to a  2 level popup index selection tree as below (#2) I can't seem to figure out how to link to pages. Any help greatly appreciated. Thanks
    1
    var itemIndex = app.popUpMenu("INTRODUCTION", "ALPHABET", "GRAMMAR", "NUMBERS", "DATES & TIME", "GETTING TO KNOW PEOPLE", "PHRASES FOR LEARNING", "DIRECTIONS & TRANSPORTATION", "DESCRIBING THE TRAIL", "DO'S & DON'TS", "EQUIPMENT", "FOOD", "INTRODUCING A VILLAGE", "CULTURE AND ETHNIC GROUPS", "HANDICRAFTS", "TEMPLES & MONKS", "AGRICULTURE", "ANIMAL HUSBANDRY", "SCHOOL & EDUCATION", "LEADING A TREK", "NATIONAL PROTECTED AREAS", "IDENTIFYING WILDLIFE", "PLANTS & FORESTS", "BOATS", "CAVES", "HEALTH AND SAFETY")
    switch (itemIndex) {
    case "INTRODUCTION":
    this.pageNum = 1
    break
    case "ALPHABET":
    this.pageNum = 2
    break
    case "GRAMMAR":
    this.pageNum = 5
    break
    case "NUMBERS":
    this.pageNum = 30
    break
    case "DATES & TIME":
    this.pageNum = 35
    break
    case "GETTING TO KNOW PEOPLE":
    this.pageNum = 42
    break
    case "PHRASES FOR LEARNING":
    this.pageNum = 56
    break
    case "DIRECTIONS & TRANSPORTATION":
    this.pageNum = 59
    break
    case "DESCRIBING THE TRAIL":
    this.pageNum = 63
    break
    case "DO'S & DON'TS":
    this.pageNum = 68
    break
    case "EQUIPMENT":
    this.pageNum = 74
    break
    case "FOOD":
    this.pageNum = 83
    break
    case "INTRODUCING A VILLAGE":
    this.pageNum = 96
    break
    case "CULTURE AND ETHNIC GROUPS":
    this.pageNum = 105
    break
    case "HANDICRAFTS":
    this.pageNum = 120
    break
    case "TEMPLES & MONKS":
    this.pageNum = 126
    break
    case "AGRICULTURE":
    this.pageNum = 131
    break
    case "ANIMAL HUSBANDRY":
    this.pageNum = 140
    break
    case "SCHOOL & EDUCATION":
    this.pageNum = 145
    break
    case "LEADING A TREK":
    this.pageNum = 151
    break
    case "NATIONAL PROTECTED AREAS":
    this.pageNum = 155
    break
    case "IDENTIFYING WILDLIFE":
    this.pageNum = 161
    break
    case "PLANTS & FORESTS":
    this.pageNum = 169
    break
    case "BOATS":
    this.pageNum = 175
    break
    case "CAVES":
    this.pageNum = 178
    break
    case "HEALTH AND SAFETY":
    this.pageNum = 182
    break
    2
    var aINTRODUCTION = ["INTRODUCTION", "How to Use This Book", "Format"];
    var aALPHABET = ["ALPHABET", "Vowel Sounds", "Consonant Sounds"];
    var itemIndex = app.popUpMenu(aINTRODUCTION, aALPHABET);
    Thanks.

    Thanks. I've got it now. I was mistakenly renaming itemIndex to each section...Introduction, Alphabet

  • LOGICAL TREES in JAVA

    hi everyone.
    i'm doing a project that requires me to use a tree structure. there is of course jtree but i dont need the user interface, i just need the structure.
    may i ask a few minutes from your time to enlighten me regarding this problem.
    please tell me the structure to use, and an example how to use it.
    please help.(deadline's in a few days.)
    thank you.

    Here's a simple Node class - to use them as a tree, all you need is a reference any node, usually the root node.
    If you run this example you get output like:
    + Root
       + Parent 0
          + Child 0.0
             - GrandChild 0.0.0
             - GrandChild 0.0.1
          + Child 0.1
             - GrandChild 0.1.0
             - GrandChild 0.1.1
       + Parent 1
          + Child 1.0
             - GrandChild 1.0.0
             - GrandChild 1.0.1
          + Child 1.1
             - GrandChild 1.1.0
             - GrandChild 1.1.1
    import java.util.Vector;
    public class Node
         private Vector mChildren= new Vector();
         private Node mParent;
         private Object mUserData;
         public Node(Object userData) {
              this(userData, null);
         public Node(Object userData, Node parent)
              mUserData= userData;
              mParent= parent;
              if (parent != null)
                   parent.addChild(this);
         public Node getParent() {
              return mParent;
         public void addChild(Node child) {
              mChildren.addElement(child);
         public int getChildCount() {
              return mChildren.size();
         public Node getChildAt(int index)
              if (index > getChildCount())
                   return null;
              return (Node) mChildren.elementAt(index);
         public boolean isLeaf() {
              return getChildCount() < 1;
         public String toString() {
              return mUserData != null ? mUserData.toString() : "null";
         public static void main(String[] argv)
              Node root= new Node("Root");
              for (int i= 0; i< 2; i++) {
                   Node parent= new Node("Parent " +i, root);
                   for (int j= 0; j< 2; j++) {
                        Node child= new Node("Child " +i +"." +j, parent);
                        for (int k= 0; k< 2; k++) {
                             Node grandChild= new Node("GrandChild " +i +"." +j +"." +k, child);
              print(root, "");
         private static void print(Node node, String indent)
              System.err.print(indent);
              System.err.print(node.isLeaf() ? "- " : "+ ");
              System.err.println(node);
              for (int i= 0; i< node.getChildCount(); i++)
                   print(node.getChildAt(i), indent +"   ");

  • Tree in java applet

    Please help
    i want to create a tree (the leaves label come from database ) in java applet... how can i start ?

    This is for a school assignment isn't it?
    The tutorial has how to read from a database, and about trees in it. There are even ready make classes for tree structures. So crack your book and give it a read, click on the tutorial link, and open the API... if it's not worth it to you, then why should it be to us?

  • How to fill a Tree in Java?

    Hello,
    I have a tree to realize the navigation on my site and now I want to build this tree in a dataProvider. I found the class SimpleTreeData which seems to link to the <nodes>-Tag but I can't get it work. Here are some code extracts:
    DataProvider:
    private SimpleTreeData createShopNode(String text, String description)
     SimpleTreeData data = new SimpleTreeData();
     data.setText( text );
     if ( description != null )
       data.setDescription( description);
     data.setDestination( "http://bali.us.oracle.com");
     data.setDestinationText( "More Information");
     return data;
    private DataObject createData(RenderingContext context, String ns, String name)
      SimpleTreeData treeRoot = new SimpleTreeData();
      SimpleTreeData shop = createShopNode("Shop", "Spend some money!");
      SimpleTreeData books = createShopNode("Books", null);
      SimpleTreeData umbrellas = createShopNode("Umbrellas", "Rain, rain go away");
      SimpleTreeData art = createShopNode("Art", "Picasso et al");
      books.addChild( art);
      shop.addChild(books);
      shop.addChild(umbrellas);
    DictionaryData lDictionaryData = new DictionaryData();
    lDictionaryData.put( "dynamicNode", shop);
    return lDictionaryData;
    This is my UIX Page:
    <provider>
    <data name="TreeProxy">
    <method class="test.DataTrees" method="getTreeProxy"/>
    </data>
    <data name="treeData">
    <method class="test.NavigationNodes"
    method="createData"/>
    </data>
    </provider>
    <tree data:proxy="proxy@TreeProxy">
    <include data:node="dynamicNode@treeData"/>
    </tree>
    Thanks,
    Christian

    Perhaps it is helpful, I get this Exception:
    java.lang.IllegalAccessException: de/oc/vera/navigation/NavigationNodes
    java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
    native code
    oracle.cabo.ui.data.DataObject oracle.cabo.ui.data.provider.MethodDataProvider.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
    oracle.cabo.ui.data.DataObject oracle.cabo.ui.data.provider.TableDataProvider.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
    oracle.cabo.ui.data.DataObject oracle.cabo.ui.data.provider.CachingDataProvider.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
    oracle.cabo.ui.data.DataObject oracle.cabo.ui.data.provider.DataProviderStack.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
    oracle.cabo.ui.data.DataObject oracle.cabo.ui.laf.base.TryRenderer$CatchContext.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
    oracle.cabo.ui.data.DataObject oracle.cabo.ui.RenderingContextProxy.getDataObject(java.lang.String, java.lang.String)
    java.lang.Object oracle.cabo.ui.data.DataBoundValue.getValue(oracle.cabo.ui.RenderingContext)
    java.lang.Object oracle.cabo.ui.BaseUINode.getAttributeValueImpl(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.AttributeKey, boolean)
    java.lang.Object oracle.cabo.ui.BaseUINode.getAttributeValue(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.AttributeKey)
    oracle.cabo.ui.data.DataObjectList oracle.cabo.ui.laf.base.BaseLafRenderer.getDataObjectListAttributeValue(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, oracle.cabo.ui.AttributeKey)
    void oracle.cabo.ui.laf.browser.TreeRenderer.renderContent(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
    void oracle.cabo.ui.BaseRenderer.render(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
    void oracle.cabo.ui.laf.xhtml.XhtmlLafRenderer.render(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
    void oracle.cabo.ui.BaseUINode.render(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
    void oracle.cabo.ui.BaseUINode.render(oracle.cabo.ui.RenderingContext)
    void oracle.cabo.ui.BaseRenderer.renderChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
    void oracle.cabo.ui.BaseRenderer.renderIndexedChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, int)

  • Help AVL Tree in JAVA code (remove) question-answer

    Hi,
    everyone. I have question.
    I want codes in Java for AVL Tree.
    I but must have remove methods or choose elements.
    It`s main for me.
    If you know, please write in code JAVA or contact e-mail.
    or link to page or if you have self code.
    thanks,
    regards
    [email protected]

    I have a better idea.
    Why don't you try to do it yourself, and when you get stuck, post your code and details of what difficulty you're having.
    When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.

  • Tree traversal Java Program

    Hi,
    I need the below implementation in JAVA :
    Scenario : Need to traverse once through all nodes of a tree
    Input :
    (i) Starting node of traversal
    (ii) List of nodes in the Tree
    (iii) Parent of all nodes, say, mapping like (each_node, list_of_its_parent) (OR) (each_node, list_of_its_child)
    Eg TREE :
    A___________________ F
    | | | |
    |__B | | |
    | C D_____|
    | |___
    H | |
    E G
    In the above example
    (node, child_list) :--
    =============
    (A, {B,C,D})
    (B, {H})
    (C, {E,G})
    (F, {D})
    In the above tree, if any node is given as the starting node, I need to traverse through the complete tree visiting all nodes once.
    Please help,
    Thanks
    Sam

    That is not a tree;Does it matter? You can always traverse a DAG as a
    tree can't you? The A in DAG means acyclic so a DAG
    is always also a tree.Check the definitions before you reply please: a DAG
    is not "aways also" a tree; no discussion about it. Don't confuse
    matters.Who's confusing matters? You introduced the DAG so
    you explain why and what consequences it has!No, I just gave a name to what the OP said: s/he didn't show a tree,
    s/he showed a DAG; that's all I did.
    So a DAG can not always be expanded to a tree? Is that what you're
    saying?There's no 'expanding' here; A tree is a very restricted DAG instead.
    kind regards,
    JosAnd zip up please. Your fake intimacy isn't always wellcome.Stay out of this discussion then; easy as that: a) you lack the knowledge
    to participate in this discussion and b) you don't like my friendly greetings,
    so the best thing for you, and for this discussion, is that you stay out of it.
    kind regards,
    Jos

  • Binary search tree in java using a 2-d array

    Good day, i have been wrestling with this here question.
    i think it does not get any harder than this. What i have done so far is shown at the bottom.
    We want to use both Binary Search Tree and Single Linked lists data structures to store a text. Chaining
    techniques are used to store the lines of the text in which a word appears. Each node of the binary search
    tree contains four fields :
    (i) Word
    (ii) A pointer pointing to all the lines word appears in
    (iii) A pointer pointing to the subtree(left) containing all the words that appears in the text and are
    predecessors of word in lexicographic order.
    (iv) A pointer pointing to the subtree(right) containing all the words that appears in the text and are
    successors of word in lexicographic order.
    Given the following incomplete Java classes BinSrchTreeWordNode, TreeText, you are asked to complete
    three methods, InsertionBinSrchTree, CreateBinSrchTree and LinesWordInBinSrchTree. For
    simplicity we assume that the text is stored in a 2D array, a row of the array represents a line of the text.
    Each element in the single linked list is represented by a LineNode that contains a field Line which represents a line in which the word appears, a field next which contains the address of a LineNode representing the next line in which the word appears.
    public class TreeText{
    BinSrchTreeWordNode RootText = null;// pointer to the root of the tree
    String TextID; // Text Identification
    TreeText(String tID){TextID = tID;}
    void CreateBinSrchTree (TEXT text){...}
    void LinesWordInBinSrchTree(BinSrchTreeWordNode Node){...}
    public static void main(String[] args)
    TEXT univ = new TEXT(6,4);
    univ.textcont[0][0] = "Ukzn"; univ.textcont[0][1] ="Uct";
    univ.textcont[0][2] ="Wits";univ.textcont[0][3] ="Rhodes";
    univ.textcont[1][0] = "stellenbosch";
    univ.textcont[1][1] ="FreeState";
    univ.textcont[1][2] ="Johannesburg";
    univ.textcont[1][3] = "Pretoria" ;
    univ.textcont[2][0] ="Zululand";univ.textcont[2][1] ="NorthWest";
    univ.textcont[2][2] ="Limpopo";univ.textcont[2][3] ="Wsu";
    univ.textcont[3][0] ="NorthWest";univ.textcont[3][1] ="Limpopo";
    univ.textcont[3][2] ="Uct";univ.textcont[3][3] ="Ukzn";
    univ.textcont[4][0] ="Mit";univ.textcont[4][1] ="Havard";
    univ.textcont[4][2] ="Michigan";univ.textcont[4][3] ="Juissieu";
    univ.textcont[5][0] ="Cut";univ.textcont[5][1] ="Nmmu";
    univ.textcont[5][2] ="ManTech";univ.textcont[5][3] ="Oxford";
    // create a binary search tree (universities)
    // and insert words of text univ in it
    TreeText universities = new TreeText("Universities");
    universities.CreateBinSrchTree(univ);
    // List words Universities trees with their lines of appearance
    System.out.println();
    System.out.println(universities.TextID);
    System.out.println();
    universities.LinesWordInBinSrchTree(universities.RootText);
    public class BinSrchTreeWordNode {
    BinSrchTreeWordNode LeftTree = null; // precedent words
    String word;
    LineNode NextLineNode = null; // next line in
    // which word appears
    BinSrchTreeWordNode RightTree = null; // following words
    BinSrchTreeWordNode(String WordValue)
    {word = WordValue;} // creates a new node
    BinSrchTreeWordNode InsertionBinSrchTree
    (String w, int line, BinSrchTreeWordNode bst)
    public class LineNode{
    int Line; // line in which the word appears
    LineNode next = null;
    public class TEXT{
    int NBRLINES ; // number of lines
    int NBRCOLS; // number of columns
    String [][] textcont; // text content
    TEXT(int nl, int nc){textcont = new String[nl][nc];}
    The method InsertionBinSrchTree inserts a word (w) in the Binary search tree. The method Create-
    BinSrchTree creates a binary search tree by repeated calls to InsertionBinSrchTree to insert elements
    of text. The method LinesWordInBinSrchTree traverses the Binary search tree inorder and displays the
    words with the lines in which each appears.
    >>>>>>>>>>>>>>>>>>>>>>
    //InsertionBinTree is of type BinSearchTreeWordNode
    BinSrchTreeWordNode InsertionBinSrchTree(String w, int line,                                             BinSrchTreeWordNode bst)
    //First a check must be made to make sure that we are not trying to //insert a word into an empty tree. If tree is empty we just create a //new node.
         If (bst == NULL)
                   System.out.println(“Tree was empty”)
         For (int rows =0; rows <= 6; rows++)
                   For (int cols = 0; cols <= 4; cols++)
                        Textcont[i][j] = w

    What is the purpose of this thread? You are yet to ask a question... Such a waste of time...
    For future reference use CODE TAGS when posting code in a thread.
    But again have a think about how to convey a question to others instead of blabbering on about nothing.
    i think it does not get any harder than this.What is so difficult to understand. Google an implementation of a binary tree using a single array. Then you can integrate this into the required 2-dimension array for your linked list implemented as an array in your 2-d array.
    Mel

  • Implementation of a parse tree in java (HELP!!!)

    I want to be able to do this in java, please how can i implement this.
         +
              a *
              b c

    It's not entirely clear what you want to do. That expression in infix notation (standard notation) would be "(b a c) + *" which doesn't make any sense. The leaves of the tree should be values, and non-leaf nodes should be operators. You can implement this by using a tree datatype in Java.

  • Implementation of a parse tree in Java (Urgent)

    How best can a parse tree be implemented in java, i have read some online information that suggest use of data structures, but i am still not clear on how to do it.

    Well, you need a tree. A logical way to structure a tree is out of "node" objects. A node presumeably will hold some data, and may also have one or more subnodes.
    So the root of your effort ought to go into designing the node - data it will hold, and getters and setters, and operations to walk the tree.

Maybe you are looking for

  • How to Get Navigational attributes of dso in Report ...

    Hi i have a dso with many fields , In the report i need to get some navgational attributes which are in dso.. How to Get Navigational attributes of dso in Report ..?? Thanks All..

  • App Store and iTunes crash ML

    I have an issue that just doesn't want to go away! I've got a fresh install of Mountain Lion and am unable to open the App Store at all. I recieve the following error and have no idea what it means. It looked like an memory error, so I downloaded a m

  • Video freezes when playing....?

    Hi, Hope someone can help. I understand all the muxed 1& 2 business. So i'm not asking about that. I have some vids on my 60Gb Ipod, some play no problems, but some I have freeze after 30 or so seconds of playback. After about 5-10 seconds the video

  • How to change object owner?

    I have a table under REPS' schema. However, I want to change the owner to ADM. Is it possible to do that without recreating the object? Is there also a way not to recreate the public synonym? Thanks!

  • Resource for coding in bw

    Hello Experts, I would like to know what resources I need to be able to start coding in bw asap. Any books or documentation for bw coding? Where can I get an extensive sample codes for different or common bw scenarios? Thanks, Shankell