We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,307 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Arraylist<node> based trees

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

3
Contributors
11
Replies
1 Day
Discussion Span
1 Year Ago
Last Updated
14
Views
sugir1987
Newbie Poster
23 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

what have you done so far?

stultuske
Industrious Poster
4,489 posts since Jan 2007
Reputation Points: 1,377
Solved Threads: 627
Skill Endorsements: 25

what have you done so far?

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

sugir1987
Newbie Poster
23 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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?

sugir1987
Newbie Poster
23 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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.

stultuske
Industrious Poster
4,489 posts since Jan 2007
Reputation Points: 1,377
Solved Threads: 627
Skill Endorsements: 25

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

sugir1987
Newbie Poster
23 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

sugir1987
Newbie Poster
23 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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.

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

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).

sugir1987
Newbie Poster
23 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Yes, I think you can do it.

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

Yes, I think you can do it.

can you give me any idea to solve this problem?

sugir1987
Newbie Poster
23 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0996 seconds using 2.74MB