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

📄 binarytree.cpp

📁 二叉树的数据结构的代码
💻 CPP
字号:
#include <iostream>
#include <fstream>
#include <cstring>
#include <stack>
#include <new>
//用new申请内存,当内存不够时,是会抛出异常的,早期的版本中new会返回NULL,所以在较新的版本中即使不加这一预处理命令也会抛出异常
#include "BinaryTree.h"
#include "Function.h"

using namespace std;

//---------------------------------------------------------------------------
int main()
{   
    int choose=0;

choose_label:
    prompt();// 友好提示语句
	cin>>choose;
	if(choose==1)
	{
		Select1();// 根据指定的前序序列建树
		goto choose_label;
	}
	else if(choose==2)
	{
		Select2();// 根据指定的前序序列和中序序列建树
		goto choose_label;
	}
	else 
		goto choose_label;
	return 0;
}
//------------------------------------------------------------------------------------

⌨️ 快捷键说明

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