#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
typedef int Status;
typedef int ElemType;
typedef char InfoType;
typedef int VertexType;
#define MAX_VERTEX_NUM 20
typedef struct ArcNode
{
int adjvex; //该弧所指向的顶点的位置
struct ArcNode *nextarc; //指向下一条弧的指针
InfoType *info; //该弧相关信息的指针
}ArcNode;
typedef struct VNode
{
VertexType data; //顶点信息
ArcNode *firstarc; //指向第一条依附该顶点的弧的指针
}VNode,AdjList[MAX_VERTEX_NUM];
typedef struct
{
AdjList vertices;
int vexnum,arcnum; //图的当前顶点数和弧数
int kind; //图的种类标志
}ALGraph; //Adjacency List Graph 邻接表
int count; //全局变量count对访问计数。
int Visited[MAX_VERTEX_NUM];
int low[MAX_VERTEX_NUM];
/*******************************声明部分****************************************/
Status CreateALGraph(ALGraph *G);
//创建邻接表方式存储的无向图
int LocateVex(ALGraph G,VertexType v);
//确定v在G中的位置
void DFSArticul(ALGraph G,int v0);
//从第v0个顶点出发深度优先遍历图G,查找并输出关节点
void FindArticul(ALGraph G);
【数据结构】算法7.10-7.11 DFS求无向图关节点
最新推荐文章于 2020-11-30 17:23:56 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)