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

📄 bintreedraw.cpp

📁 Data structures with C++ second edition source code.
💻 CPP
字号:
#include "d_tnodel.h"			// tnode library
#include "d_tdraw.h"

using namespace std;

int main()
{
	// declare a character tree
	tnode<char> *root;
	tnode<string> *strroot, *b, *c, *d, *e, *f;
	int i;

	for (i=0;i <= 2;i++)
	{
		root = buildTree(i);
		// each node requires one character
		drawTree(root,1);

		// delete the tree
		clearTree(root);
	}

	f = new tnode<string> ("Dolan");
	e = new tnode<string> ("Wren");
	d = new tnode<string> ("Gates");
	c = new tnode<string> ("Smith",e, f);
	b = new tnode<string> ("Brand",(tnode<string> *)NULL, d);
	strroot = new tnode<string> ("Daly",b, c);
	drawTree(strroot,5);

	return 0;
}

⌨️ 快捷键说明

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