mirror of
https://github.com/by777/dataStructureForC.git
synced 2026-05-11 00:49:28 +08:00
线索二叉树
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* @Author: Xu Bai
|
* @Author: Xu Bai
|
||||||
* @Date: 2019-07-23 22:43:14
|
* @Date: 2019-07-23 22:43:14
|
||||||
* @LastEditors: Xu Bai
|
* @LastEditors: Xu Bai
|
||||||
* @LastEditTime: 2019-07-24 02:24:35
|
* @LastEditTime: 2019-07-25 20:55:15
|
||||||
*/
|
*/
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
@@ -50,13 +50,23 @@ Status CreateBiThrTree(BiThrNode *T)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*T=(BiThrTree)malloc(sizeof(BiThrNode));
|
*T = (BiThrTree)malloc(sizeof(BiThrNode));
|
||||||
if (!*T)
|
if (!*T)
|
||||||
{
|
{
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
(*T)->data = h;
|
||||||
|
CreateBiThrTree(&(*T)->lchild);
|
||||||
|
if ((*T)->lchild)
|
||||||
|
{
|
||||||
|
/* 有左孩子 */
|
||||||
|
(*T)->LTag = Link;
|
||||||
|
}
|
||||||
|
if ((*T)->rchild)
|
||||||
|
{
|
||||||
|
(*T)->RTag = Link;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user