文件名称:2叉树的递归与非递归遍历
文件大小:45KB
文件格式:DOC
更新时间:2014-03-12 14:28:16
二叉树
2叉树的递归与非递归遍历的源代码void main()
{
btnode *bt;
cout<<"请输入叉树:\n";
bt=inittree();
cout<<"\n递归先根遍历:";
prevt(bt);
cout<<"\n递归中根遍历:";
midvt(bt);
cout<<"\n递归后根遍历:";
lasvt(bt);
cout<<"\n非递归后根遍历:";
nprevt(bt);
cout<<"\n非递归后根遍历:";
nmidvt(bt);
cout<<"\n非递归后根遍历:";
nlasvt(bt);
cout<