From f135253e5f558f0dc26ebecdd88ef804f0909c7b Mon Sep 17 00:00:00 2001 From: Xu Bai <1373953675@qq.com> Date: Thu, 25 Jul 2019 20:55:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E7=B4=A2=E4=BA=8C=E5=8F=89=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _04.树/_c.线索二叉树.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/_04.树/_c.线索二叉树.c b/_04.树/_c.线索二叉树.c index b388a85..c2431fd 100644 --- a/_04.树/_c.线索二叉树.c +++ b/_04.树/_c.线索二叉树.c @@ -2,7 +2,7 @@ * @Author: Xu Bai * @Date: 2019-07-23 22:43:14 * @LastEditors: Xu Bai - * @LastEditTime: 2019-07-24 02:24:35 + * @LastEditTime: 2019-07-25 20:55:15 */ #include "string.h" #include "stdio.h" @@ -50,13 +50,23 @@ Status CreateBiThrTree(BiThrNode *T) } else { - *T=(BiThrTree)malloc(sizeof(BiThrNode)); + *T = (BiThrTree)malloc(sizeof(BiThrNode)); if (!*T) { exit(-1); } - - + (*T)->data = h; + CreateBiThrTree(&(*T)->lchild); + if ((*T)->lchild) + { + /* */ + (*T)->LTag = Link; + } + if ((*T)->rchild) + { + (*T)->RTag = Link; + } } - -} \ No newline at end of file + return OK; +} +