1
0
mirror of https://github.com/Didnelpsun/CS408.git synced 2026-11-29 23:45:39 +08:00

更新串

This commit is contained in:
Didnelpsun
2021-04-26 23:48:51 +08:00
parent 400009cb71
commit 018a10d0bc
6 changed files with 248 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
#include "head.h"
#include "sequence_queue.h"
// 链树
// 链二叉树
typedef struct LinkTreeNode {
element_type data;
// 左右孩子结点
@@ -110,12 +110,12 @@ int LevelorderTraversalLinkTree(LinkTree tree, int(*visit)(LinkTree elem)) {
while (IsSequenceQueueEmpty(queue) == 0) {
// 队头出队
//ExitSequenceQueue(&queue, &p);
visit(p);
if (p->lchild != NULL) {
//EnterSequenceQueue(&queue, p->lchild);
//visit(p);
/*if (p->lchild != NULL) {
EnterSequenceQueue(&queue, p->lchild);
}
if (p->rchild != NULL) {
//EnterSequenceQueue(&queue, p->rchild);
}
EnterSequenceQueue(&queue, p->rchild);
}*/
}
}