当前位置:网站首页>Storage of Graphs~
Storage of Graphs~
2022-07-23 08:42:00 【[email protected]】
- Adjacency matrix
#define maxSize 100 // The maximum number of vertices
typedef struct {
char vex[maxSize]; // The node data type is in char For example , Changeable
int edges[maxSize][maxSize]; // Adjacency matrix definition , If you have the right figure , take int Change it to float
int n,e; // Current of the graph Number of vertices and Number of edges
}MGraph;
- Adjacency list
typedef struct ArcNode{
int adjvex; // The position index of the adjacent points in the array
struct ArcNode *nextarc; // Pointer to the next adjacent point
int info; // Information about this side , Such as : A weight , There is no requirement to write
}ArcNode;
typedef struct{
char data; // Vertex data field
ArcNode *firstarc; // A pointer to an adjacent point
}VNode;
typedef struct{
VNode adjlist [maxSize]; // An array of vertices in a graph
int n,e; // The number of vertices in the graph and edge ( Or arc ) Count
}AGraph;
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207222322314425.html
边栏推荐
- JMeter distributed pressure measurement
- selenium的testng.xml如何写
- 1.学会看懂网页
- 程序环境和预处理
- 构造函数的初始化、清理及const修饰成员函数
- Keras深度学习实战(15)——从零开始实现YOLO目标检测
- 【arXiv2022】GroupTransNet: Group Transformer Network for RGB-D Salient Object Detection
- promise(二)
- Deep parsing Kube scheduler scheduling context
- flink使用ListState实现KeyedState
猜你喜欢
随机推荐
Promise (II)
selenium的testng.xml如何写
Keras深度学习实战(15)——从零开始实现YOLO目标检测
标准C语言10
RedisTemplate Pipeline 管道使用
Xiaohongshu joins hands with HMS core to enjoy HD vision and grow grass for a better life
Go gin: multi file upload
bryntum Kanban Task Board 5.1.0 JS 看板
程序环境和预处理
类和对象上案例
坚持陪同学习
Redistemplate pipeline use
Lc: sword finger offer 39. numbers that appear more than half of the time in the array
Async and await are used in C to realize asynchronous UDP communication
C#中使用async和await实现异步Udp通讯
【wepy2.0】的安装
How to realize synchronized
华为再回应“清理34岁以上员工”传言,程序员如何应对“35岁危机”?
二叉树的结点定义 、遍历 ~
When to use usercf and itemcf?









