From 1b3639b8bc27765041029f920e2a7cd83732d4e1 Mon Sep 17 00:00:00 2001 From: Xu Bai <1373953675@qq.com> Date: Tue, 23 Jul 2019 22:52:38 +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.树/_b.二叉树链式结构.c | 6 +++--- _04.树/_c.线索二叉树.c | 41 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 _04.树/_c.线索二叉树.c diff --git a/_04.树/_b.二叉树链式结构.c b/_04.树/_b.二叉树链式结构.c index 8888c9e..12991c0 100644 --- a/_04.树/_b.二叉树链式结构.c +++ b/_04.树/_b.二叉树链式结构.c @@ -2,12 +2,12 @@ * @Author: Xu Bai * @Date: 2019-07-13 22:24:04 * @LastEditors: Xu Bai - * @LastEditTime: 2019-07-19 22:49:14 + * @LastEditTime: 2019-07-23 22:51:03 */ #include "string.h" #include "stdio.h" #include "stdlib.h" -#include "io.h" +//#include "io.h" #define OK 1 #define ERROR 0 @@ -44,7 +44,7 @@ Status StrAssign(String T, char *chars) typedef char ElemType; /*ַԿոΪ */ -ElemType Nil = ' '; +ElemType Nil = '#'; Status visit(ElemType e) { diff --git a/_04.树/_c.线索二叉树.c b/_04.树/_c.线索二叉树.c new file mode 100644 index 0000000..93f0b6d --- /dev/null +++ b/_04.树/_c.线索二叉树.c @@ -0,0 +1,41 @@ +/* + * @Author: Xu Bai + * @Date: 2019-07-23 22:43:14 + * @LastEditors: Xu Bai + * @LastEditTime: 2019-07-23 22:52:27 + */ +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "io.h" + +#define OK 1 +#define ERROR 0 +#define TRUE 1 +#define FALSE 0 +#define MAXSIZE 100 + +typedef int Status; +typedef char ElemType; +/*Link==0ʾָҺָ룬Thread==ʾ */ +typedef enum +{ + Link, + Thread +} PointerTag; + +typedef struct BiThrNode +{ + ElemType data; + struct BiThrNode *lchild, *rchild; + PointerTag LTag; + PointerTag RTag; +} BiThrNode, *BiThrTree; + +ElemType Nil = '#'; + +Status visit(ElemType e) +{ + printf("%c ", e); + return OK; +} \ No newline at end of file