摘要:
我们可以很容易的使用队列来实现二叉树的层序遍历,代码如下: 1 #include 2 #include 3 #define MAX 10 4 5 6 //二叉树存储结构定义 7 typedef char Item; 8 typedef struct node *link; 9 struct... 阅读全文
摘要:
二叉树的非递归实现需要使用到下推栈,下面给出前序遍历的完整代码: 1 #include 2 #include 3 #define MAX 10 4 5 6 //二叉树存储结构定义 7 typedef char Item; 8 typedef struct node *link; 9 str... 阅读全文