摘要: 基本思想: 第一个访问的结点应该是最左下角的结点 假设刚才访问的结点是p 然后P的后继是谁? 若p->rchild是指针,说明P有右子树,下一个结点应该是P右子树中最左下角的结点 若p->rchild是线索,直接访问p->rchild 如此循环往复... 1 #include <iostream> 阅读全文
posted @ 2017-03-28 20:23 nullxjx 阅读(2177) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <stdio.h> 3 4 using namespace std; 5 6 typedef char TElemType; 7 enum PointerTag{ Link,Thread };//Link == 0 :指针,Threa 阅读全文
posted @ 2017-03-28 19:33 nullxjx 阅读(758) 评论(0) 推荐(0) 编辑
摘要: 1 // 广度优先遍历二叉树(BFS).cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 6 7 #include <iostream> 8 #include <stdio.h> 9 #include <malloc.h> 10 #include 阅读全文
posted @ 2017-03-28 18:58 nullxjx 阅读(1431) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <stdio.h> 3 #include <malloc.h> 4 5 using namespace std; 6 7 #define STACK_INIT_SIZE 30 8 #define STACKINCREASE 10 9 阅读全文
posted @ 2017-03-28 13:04 nullxjx 阅读(498) 评论(0) 推荐(0) 编辑