2-3tree.cpp

来自「2-3树的数据结构以及演示程序」· C++ 代码 · 共 27 行

CPP
27
字号
// 2-3Tree.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
	Tree23 <int> t = Tree23 <int> ();

	char ans = 'y';
	int toInsert;
	while (ans != 'n' && ans != 'N') {
		t.formatPrint();
		General::Input("请输入要插入的结点数据域的值:", toInsert);
		if (!t.Insert(new int(toInsert))) {
			cout<<"此结点已存在,插入失败!"<<endl;
			General::pause();
		}
		else cout<<"结点"<<toInsert<<"插入成功!"<<endl;
		t.formatPrint();
		General::pause();
		General::Input("还要继续插入吗?(Y/N)", ans);
	}
	General::pause();
}

⌨️ 快捷键说明

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