二叉树实现源代码如下:
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#define OK 1
#define ERROR 0
#define TRUE 1
#define FALSE 0
#define OVERFLOW -2
typedef int status;
typedef strUCt BiNode
{
char Data;
struct BiNode* lChild;
struct BiNode* rChild;
}BiNode,*pBiNode;
status CreateTree(BiNode** pTree);
status PreOrderTraval(BiNode* pTree);
status Visit(char Data);
status Display(BiNode* pTree,int Level);
status Clear(BiNode* pTree);
BiNode *pRoot=NULL;
main()
{
clrscr();
CreateTree(&pRoot);
printf("\nPreOrder:");
PreOrderTraval(pRoot);
printf("\n");
printf("\nInOrder:");
InOrderTraval(pRoot);
printf("\n");
printf("\nPostOrder:");
PostOrderTraval(pRoot);
printf("\n");
printf("\nShowLeaves:");
ShowLeaves(pRoot);
printf("\n-----------------------\n");
printf("\n");
Display(pRoot,0);
printf("\n");
printf("\nDeleting Tree:\n");