// traverse binary tree.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> using namespace std; typedef struct BitNode { char data; BitNode *lchild,*rchild; }BitNode,*BT; void CreateBT(BT &T) { char k; cin>>k; if(k=='+') T=NULL; else { T=new BitNode; T->data=k; CreateBT(T->lchild); CreateBT(T->rchild); } } void PreTra(BT T) { if(T) { cout<<T->data<<','; PreTra(T->lchild); PreTra(T->rchild); } } const int M=1000; void Pre(BT T) //先序非递归 { BT top[M]; int i=-1; BT p;//=new BitNode; p=T; if(!T) return ; top[++i]=NULL;// the bottom of top is NULL first,void the tree has o