Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
Lab012
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
DS Lab Group
实验项目模板
Lab012
提交
307432c9
提交
307432c9
5月 21, 2019
创建
作者:
宋海霞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify
上级
f7ea3af0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
11 行删除
+11
-11
main.c
main.c
+11
-11
没有找到文件。
main.c
浏览文件 @
307432c9
...
...
@@ -13,12 +13,12 @@ int main(int argc, char* argv[])
InitStack
(
&
stack
);
//
//
创建线索二叉树
//
Create a binary tree of clues
//
pTree
=
InitTree
();
//
//
线索化二叉树
//
Threaded Binary Tree
//
pHead
=
CreateNode
(
0
);
...
...
@@ -29,20 +29,20 @@ int main(int argc, char* argv[])
/*
function:
Middle order traverses binary trees pTree ,
并将其线索化,pHead 指向其头节点
.
Middle order traverses binary trees pTree ,
And clue them in,pHead Points to its head node
.
parameter:
pTree -- pointer to a clue binary tree.
pHead -- pointer to a clue binary tree,
指向头节点
pHead -- pointer to a clue binary tree,
Head node
returned value:
线索化成功返回
1.
线索化失败返回 0
.
Cue success returns
1.
Cue fail returns 1
.
*/
int
InOrderThreading
(
PBiThrTree
pHead
,
PBiThrTree
pTree
)
{
BiThrNode
*
pNode
;
// Pointer to the clue binary tree node
BiThrNode
*
pPre
;
//
pPre 指针指向刚刚访问过的节点
BiThrNode
*
pPre
;
//
The pPre pointer points to the node that was just accessed
//
...
...
@@ -57,10 +57,10 @@ int InOrderThreading(PBiThrTree pHead, PBiThrTree pTree)
/*
function:
创建线索二叉树的一个节点
.
Creates a node in the thread binary tree
.
parameter:
data --
线索B
inary tree nodes store data
data --
the thread b
inary tree nodes store data
returned value:
Return node pointer
...
...
@@ -80,10 +80,10 @@ BiThrNode* CreateNode(ElemType data)
/*
function:
利用二叉树的先序序列创建一棵二叉树
.
Creates a binary tree using the preordering sequence of the binary tree
.
returned value:
返回
pointer to a binary tree
Return
pointer to a binary tree
*/
static
const
char
*
data
=
"-+ *b -c d /e"
;
// A binary tree preordered sequence string.
// notice:Using only preordered sequences does not determine a unique binary tree.
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论