线索二叉树

This commit is contained in:
Xu Bai
2019-07-23 22:52:38 +08:00
parent 2eea32a5e1
commit 1b3639b8bc
2 changed files with 44 additions and 3 deletions

View File

@@ -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)
{

View File

@@ -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;
}