- 3
- 0
- 约1.53千字
- 约 2页
- 2022-08-21 发布于四川
- 举报
#include stdio.h#include stdlib.h
#define MaxSize 20typedef struct BiNode
(
char data;
struct BiNode *lchild;
struct BiNode *rchild;}BitNode,*BiTree;
typedef struct{
BiTree stack[MaxSize];
int top;}sqstack;
void initStack(sqstack *s)(
s-top=-l;)
int emptyStack(sqstack *s)(
if (s-top==-l)return 1;
else return 0;)
void push(sqstack BiTree t)(
if(s-top==MaxSize-l)
printf (nSINO?ONAu£; n); else (s-top++;
s-stack[s-top]=t;
))
BiTree pop(sqstack *s)(
BiTree p;
p=s-stack[s-top];
s-top--;
return p;)
//int count=0;void createBitree(BiTree *t)
char ch;scanf(%c”,ch);
if (ch==T#!) *t=NULL; else(
*t=(BiTre
原创力文档

文档评论(0)