提交 307432c9 创建 作者: 宋海霞's avatar 宋海霞

modify

上级 f7ea3af0
...@@ -13,12 +13,12 @@ int main(int argc, char* argv[]) ...@@ -13,12 +13,12 @@ int main(int argc, char* argv[])
InitStack(&stack); InitStack(&stack);
// //
// 创建线索二叉树 // Create a binary tree of clues
// //
pTree = InitTree(); pTree = InitTree();
// //
// 线索化二叉树 // Threaded Binary Tree
// //
pHead = CreateNode(0); pHead = CreateNode(0);
...@@ -29,20 +29,20 @@ int main(int argc, char* argv[]) ...@@ -29,20 +29,20 @@ int main(int argc, char* argv[])
/* /*
function: 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: parameter:
pTree -- pointer to a clue binary tree. 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: returned value:
线索化成功返回 1. Cue success returns 1.
线索化失败返回 0. Cue fail returns 1.
*/ */
int InOrderThreading(PBiThrTree pHead, PBiThrTree pTree) int InOrderThreading(PBiThrTree pHead, PBiThrTree pTree)
{ {
BiThrNode* pNode; // Pointer to the clue binary tree node 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) ...@@ -57,10 +57,10 @@ int InOrderThreading(PBiThrTree pHead, PBiThrTree pTree)
/* /*
function: function:
创建线索二叉树的一个节点. Creates a node in the thread binary tree.
parameter: parameter:
data -- 线索Binary tree nodes store data data -- the thread binary tree nodes store data
returned value: returned value:
Return node pointer Return node pointer
...@@ -80,10 +80,10 @@ BiThrNode* CreateNode(ElemType data) ...@@ -80,10 +80,10 @@ BiThrNode* CreateNode(ElemType data)
/* /*
function: function:
利用二叉树的先序序列创建一棵二叉树. Creates a binary tree using the preordering sequence of the binary tree.
returned value: 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. 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. // notice:Using only preordered sequences does not determine a unique binary tree.
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论