A good introduction how to handle trees (and other data structures) can be
found in the free eBook "C++Course". Trees are discussed here:
http://www.vias.org/cppcourse/chap21_01.html
Regards,
Hans
=====================================
Hans Lohninger
EPINA GmbH - Software Development Lohninger
www.lohninger.com
mailto

fax: +43-2233-541945
======================================
"Aris" <> wrote in message
news:dmt2lt$988$...
> Hello!
> This is my problem.
> I'm trying to make an inorder traversal algorithm for
> a binary tree, not a recursive one, but using a stack.
> Till now I got this:
>
> void traverse(tree * p)
> {
> l: if(p==0) goto s;
> push(p);
> p=p->l; goto l;
> r: visit(p);
> p=p->r;
> goto l;
> s: if(top==0) goto x;
> p=pop(); goto r;
> x: ;
> }
>
> we call this function this way : traverse(root);
> My question is :
> how can I eliminate goto's?
> Everything I've tryed is a mess.
> I'll be greatfull if you help me.
>
>
>
>