广工数据结构Anyview - 头文件说明
以下Anyview中约定好的一些宏定义和类型定义
还没有完全补完,会持续更新
1)常用的返回类型
文件名为
Common.h
#pragma once
// 返回值宏定义
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define OVERFLOW -1
// 用作函数值类型,表示函数结果状态
typedef int Status;
2)常用的栈操作
文件名为
Stack.h
#pragma once
#include "Common.h"
#include "BiTree.h"
// 栈的元素类型
typedef BiTree SElemType;
typedef struct {
SElemType* elem;
int top;
int size;
int increment;
} Stack;
Status InitStack(Stack& S);
Status StackEmpty(Stack S);
Status Push(Stack& S, SElemType e);
Status Pop(Stack& S, SElemType& e);
Status GetTop(Stack S, SElemType& e);
3)常用的二叉树操作
文件名为
BiTree.h
#pragma once
typedef char TElemType;
typedef struct BiTNode {
TElemType data;
struct BiTNode* lchild, * rchild;
} BiTNode, * BiTree;