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.
Re: Tree structure using java
Quote:
Originally Posted by
Ericyue
if i want to let the array element have the id, what should i put in ?
Erm, an id?
Quote:
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
Re: Tree structure using java
Moved from Advanced Java
db