赞
踩
目标效果:
bintree.h页面:
- #ifndef BINTREE_H_INCLUDED
- #define BINTREE_H_INCLUDED
-
- #include <stdlib.h>
- #include "ds.h"
-
- //数据元素的缺省类型用char
- #ifndef ElemType
- #define ElemType char
- #define ELEMTYPE_TAG
- #endif
- /*下面使用TElemType如同ElemType*/
- #define TElemType ElemType
- #define SElemType BiTree
- ///
- // 二叉链表类型
- typedef struct BiTNode {
- TElemType data;
- struct BiTNode *lchild, *rchild; //左右孩子指针
- } BiTNode, *BiTree;
- //顺序栈的存储结构定义
- #define STACK_INIT_SIZE 100 /* 存储空间初始分配容量 */
- #define STACKINCREMENT 10 /* 存储空间分配的增量 */
- typedef struct {
- SElemType *base; //在构造栈之前和销毁栈之后,base为NULL
- SElemType *top; //栈顶指针
- int stacksize; //当前已分配的存储空间(元素个数)
- } SqStack;
-
- //元素e入栈S

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。