Solved

Java iterate through different levels of childs

Posted on 2012-04-03
2
261 Views
Last Modified: 2013-11-24
I'm creating a mindmapping application
as of now I have a Node class. This Node object can have several Node objects as childs ( a list of Nodes).

Now as this can have several levels deep how do you iterate through all these Nodes?
0
Comment
Question by:Mutsop
2 Comments
 
LVL 31

Accepted Solution

by:
GwynforWeb earned 500 total points
ID: 37802542
Are they arranged in a tree? If so I suggest you look at this http://en.wikipedia.org/wiki/Tree_traversal . There are different ways of going through the tree.
0
 
LVL 3

Author Closing Comment

by:Mutsop
ID: 37803103
aah haven't thought about it
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 80
Java Options in Zimbra Server 2 47
nextBoolean(double p) for Random class 3 35
servlet example issue 6 33
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now