hi all
i have to implement arraylist<node> base tree(one parent may have more than two children). i did not work with node can you help me to create the tree

Recommended Answers

All 11 Replies

what have you done so far?

what have you done so far?

i'm a beginner of java.can you help me to create the tree?

hi all
i have to implement arraylist<node> base tree(one parent may have more than two children). i did not work with node can you help me to create the tree

i'm a beginner of java.can you help me to create the tree?

we can help you correct your code, we're not going to code it for you.
Do you know how to work with (Array)Lists and Generics?

if not, and you're indeed a beginner just starting up, leave stuff like this untill you've got a better hang of java programming.

we can help you correct your code, we're not going to code it for you.
Do you know how to work with (Array)Lists and Generics?

if not, and you're indeed a beginner just starting up, leave stuff like this untill you've got a better hang of java programming.

i'm working with arraylist

i'm working with arraylist

i can implement the binary tree in java. at least help me to insert the children into the arraylist here one parent may have more than two children

Have you read the API doc for the ArrayList class?
Do any of its methods look like they would "insert" an element into the list?
Have you tried any of the methods to see what they do?
Try writing a small, simple program that creates an ArrayList and add elements to it.

Have you read the API doc for the ArrayList class?
Do any of its methods look like they would "insert" an element into the list?
Have you tried any of the methods to see what they do?
Try writing a small, simple program that creates an ArrayList and add elements to it.

now i have to create dynamic children tree.a single array-list is possible to do this?
for example i have to create this kind of tree

7
/ | \
2 7 12
/ | \ / \ / \
1 2 3 6 8 11 13

here each parent has average of children. here i have three condition such as (consider the child node as x) 1<=x<=5,6<=x<=10,x>=11.here i have three group of children.how can separate this group of children from a single array-list. is it possible or not. if it is possible can you give me a code to insert the children in array-list (with example).

Yes, I think you can do it.

Yes, I think you can do it.

can you give me any idea to solve this problem?

Are you having problems with your code?
Please post your code and your questions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.