⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 treemain.cpp

📁 数据结构清华大学出版社出版 有书上例子的源代码
💻 CPP
字号:
//有关树的实现的主函数,文件名为treemain.cpp
#include <iostream>
#include <string>
#include"tree.cpp"
using namespace std;

void main() 
{
    Tree<string> t; //创建一棵树
	TNode<string>* p = t.Getroot( );  //获取指向根结点的指针 
	cout<<"------前序遍历------ "<<endl;
	t.PreOrder(p);
	cout<<endl;
	cout<<"------后序遍历------ "<<endl;
	t.PostOrder(p);
	cout<<endl;
	cout<<"------层序遍历------ "<<endl;
	t.LeverOrder(p);
	cout<<endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -