Results 1 to 3 of 3
  1. #1
    Ericyue is offline Member
    Join Date
    Mar 2012
    Posts
    18
    Rep Power
    0

    Default Tree structure using java

    Hi, where can i find the example of array using java. I would like to do a simulator by using Java.

    array 1 will have only 1 element but array 2 can have 100 element.

    this is the array that i create.

    class createClient {

    int[] createClientArray;
    createClientArray = new int[1];
    }

    if i want to let the array element have the id, what should i put in ?

    Another question is can i let the array 2 to be arrange in binary tree ?

    Thanks.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,732
    Blog Entries
    7
    Rep Power
    21

    Default Re: Tree structure using java

    Quote Originally Posted by Ericyue View Post
    if i want to let the array element have the id, what should i put in ?
    Erm, an id?

    Another question is can i let the array 2 to be arrange in binary tree ?
    Just sort the array; afterwards you can consider it a full binary search tree were a node at position #i has children at positions #2*i+1 and #2*i+2

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,452
    Rep Power
    20

    Default Re: Tree structure using java

    Moved from Advanced Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Tree structure
    By toofast in forum Advanced Java
    Replies: 3
    Last Post: 06-14-2012, 05:25 PM
  2. Tree data structure
    By Nacao in forum New To Java
    Replies: 18
    Last Post: 08-23-2011, 07:26 PM
  3. Tree Structure
    By chiku in forum New To Java
    Replies: 2
    Last Post: 01-27-2011, 09:31 PM
  4. Tree structure using JAVA
    By trill in forum Advanced Java
    Replies: 2
    Last Post: 05-27-2010, 12:02 PM
  5. standart tree structure?
    By willemien in forum New To Java
    Replies: 3
    Last Post: 05-06-2010, 08:56 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •