- 1、本文档共15页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
无向图的关节点(No to the joint point of graph)
无向图的关节点(No to the joint point of graph)
#包含iostream
#包括字符串
使用名称空间;
#定义max_vertex_num 20
typedef struct阿克诺德{
国际adjvex;/ /该弧所指向的顶点的位置
struct阿克诺德* nextarc;/ /指向下一条弧的指针
/ / / /该弧相关信息字符串信息;
} ArcNode;
typedef struct VNode {
int数据;/ /顶点信息
阿克诺德* firstarc;/ /指向第一条依附该顶点的弧的指针
} VNode,adjlist [ max_vertex_num ];
typedef struct {
adjlist顶点;/ /存储图
int毒液,arcnum;/ /图的当前顶点数和弧数
int类型;/ /图的种类标志
} ALGraph;
int CreateUG(algraph G){
cout “请输入图中顶点个数和边数:”;
g.arcnum g.venum CIN;
int i;
为(i = 0;i g.venum;i++){
g.vertices [我]。数据= I + 1;
g.vertices [我]。firstarc = null;
}
为(i = 0;i g.arcnum;i++){
cout “请输入你要加入的边的信息:”;
int,V2;
;
阿克诺德*电流= g.vertices [ v1-1 firstarc ];
阿克诺德×P = g.vertices [ v1-1 firstarc ];
如果(当前= NULL){
g.vertices [ v1-1 ]。firstarc =新阿克诺德;
g.vertices [ v1-1 ]。firstarc - adjvex = V2-1;
g.vertices [ v1-1 ]。firstarc - nextarc = null;
}
别的{
而(当前!= NULL){
电流;
电流=电流- nextarc;
}
电流=新阿克诺德;
电流- adjvex = V2-1;
电流- nextarc = null;
P nextarc =电流;
}
电流= g.vertices V2-1 firstarc [ ];
P = g.vertices V2-1 firstarc [ ];
如果(当前= NULL){
g.vertices [ V2-1 ]。firstarc =新阿克诺德;
g.vertices [ V2-1 ]。firstarc - adjvex = v1-1;
g.vertices [ V2-1 ]。firstarc - nextarc = null;
}
别的{
而(当前!= NULL){
电流;
电流=电流- nextarc;
}
电流=新阿克诺德;
目前adjvex = v1-1 -;
电流- nextarc = null;
P nextarc =电流;
}
}
返回1;
}
int CreateDG(algraph G){
cout “请输入图中顶点个数和边数:”;
g.arcnum g.venum CIN;
int i;
为(i = 0;i g.venum;i++){
g.vertices [我]。数据= I + 1;
g.vertices [我]。firstarc = null;
}
for (i = 0; i g.arcnum; i + +) {
cout 请输入你要加入的边的信息:;
int v1, v2;
cin v1 v2;
arcnode * current = g.vertices [v1 1].firstarc;
arcnode * p = g.vertices [v1 1].firstarc;
if (current = = null) {
g.vertices [v1 1].firstarc = new arcnode;
g.vertices [v1 1].firstarc - adjvex = v2 - 1;
g.vertices [v1 1].firstarc - nextarc = null;
}
else {
while (current! = null) {
p = current;
current = current - nextarc;
}
current = new arcnode;
current - adjvex = v2 - 1;
current - nextarc = null;
p - nextarc = current;
}
}
return 1;
}
int createdg1 (algraph
您可能关注的文档
- 微流控非接触电导检测芯片的设计与模拟(The design and Simulation of microfluidic chip with contactless conductivity detection).doc
- 微生物检验主管技师基础知识模拟(Basic knowledge of microbial test technician simulation).doc
- 微生物生态学笔记(Notes of microbial ecology).doc
- 微生物试题(Microbial test).doc
- 微笑曲线理论(Smile curve theory).doc
- 微机设计(Design of Microcomputer).doc
- 微生物采集石油的方案(The microbial oil collection scheme).doc
- 微软历史(The history of Microsoft).doc
- 微电子技术 全真模拟试卷(Microelectronic technology simulation test).doc
- 德国垃圾分类常识(Germany garbage classification knowledge).doc
- 初中生亲子阅读与阅读策略训练研究论文.docx
- 高中数学课堂如何提升学生空间想象力的教学策略研究论文.docx
- 初中英语课堂互动模式下的教学策略与教学评价改革与实践研究论文.docx
- 小学美术教育中创新思维培养路径研究论文.docx
- 绿色化学实验在初中化学教学中的应用与优化策略论文.docx
- 小学生早餐饮食习惯对视力保护作用的研究与饮食习惯教育论文.docx
- 初中生艺术社团活动对学生社会责任感培养的实证研究论文.docx
- 小学数学课堂学生数学学习心理辅导策略创新研究论文.docx
- 劳动教育在学生劳动教育理论研究中的地位论文.docx
- 小学英语单元整体教学目标与多元智能理论的结合实践论文.docx
文档评论(0)