运行结果正确

#include<stdio.h>
#include <stdlib.h>
#include <string.h>
#include<malloc.h>
//邻接矩阵表示图
typedef struct g_node *g_point;
struct g_node{
int ne;//边数
int nv;//节点数
int arr[100][100];
int data[100];
};
//边的数据结构
typedef struct e_node *e_point;
struct e_node{
int v1;
int v2;
int weight;
};
//遍历一个邻接矩阵的图
void tra_g(g_point g,int n){
本文详细介绍了如何用C语言通过邻接矩阵来表示无向图,包括图的基本概念、邻接矩阵的定义以及相关操作代码实现,展示了无向图的存储和遍历方法。
最低0.47元/天 解锁文章
1218

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



