bitreemain.cpp
来自「二叉树数据结构。 用vc6.0编写。 参考清华大学数据结构」· C++ 代码 · 共 27 行
CPP
27 行
#include<iostream>
#include<string>
#include"bitree.cpp"
using namespace std;
void main()
{
BiTree<string> bt;
BiNode<string>* root = bt.Getroot( ); //获取指向根结点的指针
cout<<"------前序遍历------ "<<endl;
bt.PreOrder(root);
cout<<endl;
cout<<"------中序遍历------ "<<endl;
bt.InOrder(root);
cout<<endl;
cout<<"------非递归中序遍历------ "<<endl;
bt.NotRecInOrder(root);
cout<<endl;
cout<<"------后序遍历------ "<<endl;
bt.PostOrder(root);
cout<<endl;
cout<<"------层序遍历------ "<<endl;
bt.LeverOrder(root);
cout<<endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?