以下这些必须全部记住!!!
//基础数据结构
//顺序表
typedef struct seqlist{
int n; //顺序表长度
int maxLength; //顺序表的最大允许长度
int *element;
}SeqlList;
//单链表
typedef struct node{
int element; //数据域
struct node *link; //指针域
}Node; //单链表结点的定义
typedef struct singlelist{
int n; //单链表中元素个数
Node *first; //头指针
}SingleList; //单链表的定义
//稀疏矩阵
typedef struct term{ //三元组表
int row; //行下标
int col; //列下标
int value; //非零元素的值
}Term;
typedef struct sparsematrix{
int m; //行数量
int n; //列数量
Term *table; //非零元素数量
}SparseMatrix;
//二叉树
typedef struct btnode{ //结点的定义
int element;
struct btnode *lChild;
struct btnode *rChild;
}BtNode;
typedef struct binarytree{ //二叉树的定义
struct BtNode *root; //根节点
}BinaryTree;
//基于孩子兄弟的树形结构
typedef struct tnode{
int element;
struct tnode *leftChild;
struct tnode *rightSibiling;
}TNode;
typedef struct tree{
TNode *root;
}Tree;
//基于双亲表示法的树形结构
typedef struct tnode{
int element;
int parent_pos;
}TNode;
typedef struct tree{
int n;
int maxSize;
TNode *a; //结点数组
}Tree;
//二叉搜索树
typedef struct bstnode{
int element;
struct bstnode *lChild;
struct bstnode *rChild;
}BSTNode;
typedef struct bstree{
BSTNode *root;
}BSTree;
//散列表
typedef struct node{
int data;
struct node *next;
}Node;
typedef struct ht{
int M; //散列表长度
Node **table;
}HT;
//图
//邻接矩阵
typedef struct mgraph{
int n; //结点数量
int e; //边数量
int **a; //二维数组
}MGraph;
//邻接表
typedef struct enode{
int adjVex; //与任意顶点相邻接的顶点
struct enode *nextArc; //指向下一个边结点
}ENode;
typedef struct lgraph{
int n;
int e;
int **a; //一维数组指针
}LGraph;