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 online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    11,606
    Blog Entries
    7
    Rep Power
    17

    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
    When people rob a bank they get a penalty; when banks rob people they get a bonus.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,095
    Rep Power
    17

    Default Re: Tree structure using java

    Moved from Advanced Java

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

  1. Tree structure
    By toofast in forum Advanced Java
    Replies: 3
    Last Post: 06-14-2012, 04:25 PM
  2. Tree data structure
    By Nacao in forum New To Java
    Replies: 18
    Last Post: 08-23-2011, 06:26 PM
  3. Tree Structure
    By chiku in forum New To Java
    Replies: 2
    Last Post: 01-27-2011, 08:31 PM
  4. Tree structure using JAVA
    By trill in forum Advanced Java
    Replies: 2
    Last Post: 05-27-2010, 11:02 AM
  5. standart tree structure?
    By willemien in forum New To Java
    Replies: 3
    Last Post: 05-06-2010, 07: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
  •