二叉树的创建
由完备的先序序列创建二叉树
typedef struct bt //二叉树
{
int data;
struct bt* Lchild;
struct bt* Rchild;
}TREE,*LPtree;
LPtree Node(int data) //创建结点
{
LPtree newNode=new TREE;
newNode->data=data;
newNode->Lchild=NULL;
newNode->Rchild=NULL;
return newN
原创
2021-09-18 18:15:36 ·
132 阅读 ·
0 评论