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

📄 test.c

📁 《数据结构-使用C语言》第三版
💻 C
字号:
#include<stdlib.h>
#include<stdio.h>
#include<malloc.h>

typedef char DataType;
void Visit(DataType item)
{
	printf("%c",item);
}

#include"BiTreeNode.h"

int main()
{
	BiTreeNode *root, *p, *pp;
	Initiate(&root);
	
	p=InsertLeftNode(root,'A');
	p=InsertLeftNode(p,'B');
	p=InsertLeftNode(p,'D');
	p=InsertRightNode(p,'G');
	p=InsertRightNode(root->leftChild,'C');
	
	pp=p;
	InsertLeftNode(p,'E');
	InsertRightNode(pp,'F');
	
	PrintBiTree(root->leftChild,0);
	
	printf("前序遍历:\n");
	PreOrder(root->leftChild, Visit);
	
	printf("\n中序遍历:\n");
	InOrder(root->leftChild, Visit);
	
	printf("\n后序遍历:\n");
	PostOrder(root->leftChild, Visit);
	
	Destroy(&root);
	getchar();
}

⌨️ 快捷键说明

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