1. 请根据用户输入的“扩展的先序遍历序列”(用小圆点表示空子树),建立以二叉链表方式存储的二叉树,然后写出后序遍历该二叉树的非递归算法,并将对应的程序调试运行通过。
#include<stdio.h>
#include<stdlib.h>
#define FALSE 0
#define TRUE 1
#define ERROR 0
#define OK 1
#define OVERFLOW -2
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
typedef int status;
//二叉树的二叉链表存储表示
typedef struct BiTNode{
struct BiTNode *lchild, *rchild;
char data;
}BiTNode, * BiTree;
//顺序栈的存储表示
typedef struct SqStack{

根据用户输入的扩展先序遍历序列,使用二叉链表构建二叉树。文章提供了后序遍历非递归算法的实现,并已通过程序调试。
最低0.47元/天 解锁文章
5175

被折叠的 条评论
为什么被折叠?



