Re: binary tree traversal...

2005-01-30 Thread Glynn Clements
J. wrote: > I am trying to traverse a binary tree, returning each node that is > encounterd so that I can preform operations on that node. However it keeps > looping over the same first node, it refuses to travel any further down > the tree ... What did I overlooked ? I know the tree is loaded wi

Re: binary tree traversal...

2005-01-27 Thread J.
On Wed, 26 Jan 2005, Eric Bambach wrote: > On Wednesday 26 January 2005 05:01 pm, J. wrote: > > Wednesday, January 26 > > I guess there is something wrong in my reasoning about this... > > Yea, that definatly wont work. I think you're messing up because a recursive > function can only pass back

Re: binary tree traversal...

2005-01-26 Thread Joel Pareja
Hi, It did traverse your binary tree. However, your call to printf is only performed with the first(?) node. I think this is how to accomplish what you want. snippet+ --- { treerecurse(root); // you don't need a loop here } struct tnode *treerecurse(struct tnode *p) {

Re: binary tree traversal...

2005-01-26 Thread Eric Bambach
On Wednesday 26 January 2005 05:01 pm, J. wrote: > Wednesday, January 26 > > Hello, > > I am trying to traverse a binary tree, returning each node that is > encounterd so that I can preform operations on that node. However it keeps > looping over the same first node, it refuses to travel any furthe

binary tree traversal...

2005-01-26 Thread J.
Wednesday, January 26 Hello, I am trying to traverse a binary tree, returning each node that is encounterd so that I can preform operations on that node. However it keeps looping over the same first node, it refuses to travel any further down the tree ... What did I overlooked ? I know the tree i