BTree.h
#ifndef __BTree_H__
#define __BTree_H__
#include<stdlib.h>
#include<stdio.h>
#include<assert.h>
typedef char DataType;
typedef struct BTreeNode
{
DataType data;
struct BTreeNode *left;
struct BTreeNode *right;
}BTreeNode;
void CreatBTree(BTreeNode **cur, DataType *str, DataType invalid, int *index);
void Preorder(BTreeNode *cur);
void Inorder(BTreeNode *cur);
void Postorder(BTreeNode *cur);
void Destroy(BTreeNode **cur);
void CpBTree(BTreeNode *cur, BTreeNode **ret);
int BTreeHight(BTreeNode *cur);
int BTreeNum(BTreeNode *cur);
int BTree(BTreeNode *cur);
int BTreeKnum(BTreeNode *cur, int K);
BTreeNode *LeftNode(BTreeNode *cur, DataType data);
BTreeNode *RightNode(BTreeNode *cur, DataType data);
BTreeNode* ParentNode(BTreeNode *cur, DataType data);
#endif
BTree.c
#include"BTree.h"
//申请一个节点
BTreeNode *BuyBTreeNode(DataType data)
{
BTreeNode *NewNode = (BTreeNode *)malloc(sizeof(BTre