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

📄 bintree.h

📁 这是关于二叉树的建立
💻 H
字号:
#include "Queue.h"
#include "stack.h"
//二叉树用类实现
//二叉树的前序遍历用递归算法实现
//二叉树的后序遍历用非递归算法实现
//二叉树的层次遍历用队列实现
class BinTree
{
public:
	BinTree();
	~BinTree();
	BinTree * Create();		//二叉树的建立	
	BinTree * CreateCir();	//建立过程中需要的递归函数
	void PreOrder(BinTree *);	//前序遍历
	void MidOrder(BinTree *);	//中序遍历
	void PostOrder(BinTree *);	//后序遍历
	void LayOrder(BinTree *);	//层次遍历
protected:
	char data;
	BinTree *Lchild;
	BinTree *Rchild;
private:
	SeqStack *S;	//非递归算法用到的栈
	LinkQueue *Q;	//层次遍历要用的队列
};

⌨️ 快捷键说明

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