binarytree.cpp

来自「二叉树的数据结构的代码」· C++ 代码 · 共 35 行

CPP
35
字号
#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 + =
减小字号Ctrl + -
显示快捷键?