![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构_Alendorature
Alendorature
越努力,越幸运!
展开
-
数据结构:邻接表法构造无向图以及DFS、BFS算法(C++版本)
#include <iostream> #include <string.h>//memset函数需要 #define MVNum 100 //最大数using namespace std;int visited[MVNum];//邻接表构造法typedef struct ArcNode{ int adjvex;//邻接点域(即下标) struct ArcNode *nextarc; }ArcNode;typedef struct VNode{ int da原创 2022-01-16 12:12:06 · 581 阅读 · 0 评论 -
数据结构:邻接矩阵法构造无向网(C版本)
全部代码如下:#include <stdio.h>#include <stdlib.h>#define MAXInt 0//表示极大值,用于权值(即网) #define MVNum 100 //最大顶点数//邻接矩阵构造法 typedef struct { int vex[MVNum];//顶点表 int arcs[MVNum][MVNum];//邻接矩阵 int vexnum,arcnum; }AMGraph;int LocateVex(AMGraph &原创 2021-12-14 14:25:10 · 2216 阅读 · 1 评论