//非递归实现树的前序遍历
void BinTree::PreOrder(LinkNode* current)
{
stack<LinkNode*> s(50,-1);
LinkNode* p=current;
while(p!=NULL)
{
s.push(p);
p=p->getLChild();
if(!s.IsEmpty())
{
cout<<s.getTop()->getData()<<" ";
}
while(p==NULL)
{
if(s.IsEmpty())
break;
p=s.getTop()->getRChild();
s.pop();
}
}
}