(五十九)第 9 章 查找(B 树)
示例代码
bTree.h
// B 树实现头文件#ifndef B_TREE_H
#define B_TREE_H#include "errorRecord.h"#define RANK 3 // B 树的阶,暂设为 3
#define N 16 // 数据元素个数
#define MAX 5 // 字符串最大长度 + 1typedef int KeyType; // 设关键字域为整型typedef struct {char info[MAX];
} Others; // 记录的其它部分typedef struct {KeyType key; // 关键字Others others; // 其它部分(由主程定义)
} Record; // 记录类型typedef struct BTNode {int keyNum; // 结点中关键字个数,即结点的大小struct BTNode *parent; //