C++二叉树的基本操作包括创建、查找、删除、插入、修改、遍历和删除等基本操作(C++版本)
发布时间
阅读量:
阅读量
#include <iostream>
using namespace std;
class BinaryTree ;
class BinTreeNode //结点类的定义
{
friend BinaryTree;
private:
BinTreeNode *leftChild, *rightChild; //左、右子女链域
char data; //数据域
public:
BinTreeNode ( )
{
leftChild =NULL;
rightChild =NULL;
}
BinTreeNode ( char x,BinTreeNode *left = NULL,BinTreeNode *right = NULL ) : data (x), leftChild (left), rightChild(right) { } //构造函数
~BinTreeNode ( ) { }
全部评论 (0)
还没有任何评论哟~
