bitreeexample.h

来自「里面包含各种数据结构方面的知识,如链表,树,图等 含有vc代码」· C头文件 代码 · 共 50 行

H
50
字号
void MakeCharTree(BiTreeNode<char>*  &root, int num)
{
	BiTreeNode<char> *a, *b, *c, *d, *e, *f, *g, *h, *i;
	BiTreeNode<char> *j, *k, *l, *m, *n, *o, *null = NULL;

	if(num == 1)
	{
		g = GetTreeNode('G');
		d = GetTreeNode('D', g);
		b = GetTreeNode('B', d);
		e = GetTreeNode('E');
		f = GetTreeNode('F');
		c = GetTreeNode('C', e, f);
		root = GetTreeNode('A', b, c);
	}
	else if(num == 2)
	{
		g = GetTreeNode('G');
		d = GetTreeNode('D', null, g);
		b = GetTreeNode('B', d);
		e = GetTreeNode('E');
		f = GetTreeNode('F');
		c = GetTreeNode('C', e, f);
		root = GetTreeNode('A', b, c);
	}
	else if(num == 3)
	{
		h = GetTreeNode('H');
		i = GetTreeNode('I');
		d = GetTreeNode('D', h, i);
		j = GetTreeNode('J');
		k = GetTreeNode('K');
		e = GetTreeNode('E', j, k);
		b = GetTreeNode('B', d, e);
		l = GetTreeNode('L');
		m = GetTreeNode('M');
		f = GetTreeNode('F', l, m);
		n = GetTreeNode('N');
		o = GetTreeNode('O');
		g = GetTreeNode('G', n, o);
		c = GetTreeNode('C', f, g);
		root = GetTreeNode('A', b, c);
	}
}

void Printchar(char item)
{
	cout << item<<" ";
}

⌨️ 快捷键说明

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