mirror of
https://github.com/by777/dataStructureForC.git
synced 2026-02-02 17:48:51 +08:00
线索二叉树
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
41
_04.树/_c.线索二叉树.c
Normal file
41
_04.树/_c.线索二叉树.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user