顺序表
typedef struct{
elemtype elem[maxsize];
int length;
}Seqlist;
链表
typedef struct node {
Datatype data;
struct node* next;
}Lnode,*Linklist;
顺序栈
typedef struct {
elemtype elem[maxsize];
int top;
}Seqstack;
链栈
typedef struct Stacknode {
Datatype data;
struct Stacknode* next;
}slStackytpe;
循环队列
typedef struct {
elemtype elem[maxsize];
int front,rear,length;
}CCeQuene;
链队列
typedef struct node {
Datatype data;
struct node* next;
}QNode;
typedef struct {
QNode* front;
QNode* rear;
}LQNode;
顺序存储二叉树
typedef struct {
elemtype elem[maxsize+1];
int nodemax;
}Bitree;
二叉链表
typedef struct node {
Datatype data;
struct node* lchild;
struct node* rchild;
}*BItree;
邻接矩阵
typedef struct {
int arc[max][max];
Vextype vex[max];
int vexnum;
int arcnum;
}AdjM;
邻接表
typedef struct arcnode {
int vex;
//int weight;
struct arcnode* next;
}arcnode;
typedef struct vexnode {
char vexdata;
struct arcnode* head;
}vexnode;
typedef struct {
vexnode vervex[max];
int numvex;
int arcnum;
}AdjL;
经典数据结构定义
本文详细定义了多种数据结构,包括顺序表、链表、栈、队列、二叉树及图等基本类型,并给出了对应的结构体声明。这些数据结构是计算机科学的基础,广泛应用于算法设计与实现中。

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



