<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=186542309-08072007>Hello
everyone,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=186542309-08072007>
I'd like to know How I can traverse through the nodes of GATreeGenome. As far as
I understood it is not possible break the loop if we use the next()
member function to jump to the next child node since the youngest child
node always linked to the eldest child node or itself in the case of single
child node. if we use the following traversing
function </SPAN></FONT></DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial
size=2><I></I></FONT></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial size=2>string
visitPost(GATreeGenome<NodeType> &t)</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial
size=2>{</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=186542309-08072007> <FONT face=Arial
size=2> stringstream ret</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial
size=2> if(t.child()) ret <<
visitPost(t.child()) << " ";<BR>
if(t.next()) ret << visitPost(t.next()) << "
";<BR> </FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial
size=2> cout << *t.current() << "
";<BR></FONT><FONT face=Arial size=2> return
ret.str();<BR>}</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial size=2>How can the
recursive loop be broken though the t.next() function which doesn't return a
NULL pointer in any case ? Also I'd like to know How I can access the node
pointers of the Tree structure not the contents of the nodes
?</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=186542309-08072007></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial
size=2> Sincerely</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=186542309-08072007><FONT face=Arial
size=2> Cem
DEMiRKIR </FONT></DIV></SPAN></FONT></BODY></HTML>