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

📄 mytree.cpp

📁 二叉树结构的定义
💻 CPP
字号:
// wok.cpp : Defines the entry point for the console application.
//

#include "StdAfx.h"
#include "iostream.h"
#include "stdlib.h"
#include "Stack.h"
int main(int argc, char* argv[])
{
	Stack S;
	Bitree* T,*p;
	T=new Bitree;
	cout<<"先序输入二叉树:"<<endl;
    
	T->CreatBitree();
	p=T;
	cout<<"中序遍历二叉树:"<<endl;
	while(p!=0||(!S.StackEmpty()))
	{
		if(p)
		{
			S.push(p);
			p=p->lchild;
		}
		else
		{
			p=S.pop();
			if(p->data!='#')
			cout<<p->data;
			p=p->rchild;	
		}
	}
	cout<<endl;
	return 0;
}

⌨️ 快捷键说明

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