当前位置: 首页 > news >正文

重庆市工程建设标准化信息网沈阳seo关键词

重庆市工程建设标准化信息网,沈阳seo关键词,孝南区建设局网站,网站建设 三门峡一.邻接矩阵的空间复杂度 假设图G有n个顶点e条边,则存储该图需要O(n^2) 不适用稀疏图的存储 二.邻接表 1.邻接表的存储思想: 对于图的每个顶点vi,将所有邻接于vi的顶点链成一个单链表,称为顶点vi的边表&#xff08…

一.邻接矩阵的空间复杂度

假设图G有n个顶点e条边,则存储该图需要O(n^2)

不适用稀疏图的存储

二.邻接表

1.邻接表的存储思想:

对于图的每个顶点vi,将所有邻接于vi的顶点链成一个单链表,称为顶点vi的边表(对于有向图则称为出边表),所有边表的头指针和存储顶点信息的一维数组构成了顶点表。

2.邻接表的结构定义

struct ArcNode{int adjvex;struct ArcNode *next;
};template <class T>
struct VertexNode{T vertex;struct ArcNode *firstEdge;
};

邻接表的空间复杂度为O(n+e)

更适用于有向图的存储

3.无向图的邻接表

1.如何求顶点i的度?

顶点i的边表中结点的个数 

2.如何判断顶点vi和vj之间是否有边?

测试顶点vi的边表中是否有终点为j的结点

4.有向图的邻接表

1.如何求顶点i的出度?

顶点i的边表中结点的个数 

2.如何求顶点i的入度?

各顶点的出边表中以顶点i为终点的结点个数

5.网图的邻接表

三.邻接表存储有向图的类

struct ArcNode{int adjvex;struct ArcNode *next;
};template <class T>
struct VertexNode{T vertex;struct ArcNode *firstEdge;
};
template <class T>
class ALGraph{
private:VertexNode<T> adjList[MAX_VERTEX];int vertexNum,arcNum;
public:ALGraph(T v[],int n,int e);~ALGraph();void DFSTraverse();void BFSTraverse();
};

template <class T>
ALGraph<T>::ALGraph(T v[],int n,int e){int vi,vj;ArcNode *s;vertexNum=n;arcNum=e;for(int i=0;i<n;i++){adjList[i].vertex=v[i];adjList[i].firstEdge=NULL;}for(int i=0;i<arcNum;i++){cin>>vi>>vj;s=new ArcNode;s->adjvex=vj;s->next=adjList[vi].firstEdge;adjList[vi].firstEdge=s;}
}
template <class T>
ALGraph<T>::~ALGraph(){int i,j;ArcNode *p;for(i=0;i<vertexNum;i++){p=adjList[i].firstEdge;if(p){while(p){adjList[i].firstEdge=p->next;delete p;p=adjList[i].firstEdge;}}}
}

 

四.逆邻接表

对于邻接表来说,查找入度非常困难。

所以引入了逆邻接表。

五.十字链表 

十字链表的结点结构:

六.图的存储结构的比较


文章转载自:
http://baubee.c7500.cn
http://globe.c7500.cn
http://acpi.c7500.cn
http://crawly.c7500.cn
http://bitch.c7500.cn
http://midsplit.c7500.cn
http://montanic.c7500.cn
http://throwoff.c7500.cn
http://cantonal.c7500.cn
http://electricize.c7500.cn
http://inefficient.c7500.cn
http://mortify.c7500.cn
http://unjealous.c7500.cn
http://allegiant.c7500.cn
http://multiplication.c7500.cn
http://hattery.c7500.cn
http://codicology.c7500.cn
http://strobilation.c7500.cn
http://schematiye.c7500.cn
http://unchangeably.c7500.cn
http://unacquirable.c7500.cn
http://streamflow.c7500.cn
http://stylise.c7500.cn
http://wonderfully.c7500.cn
http://obiit.c7500.cn
http://archduchess.c7500.cn
http://peristalith.c7500.cn
http://upswell.c7500.cn
http://possibilistic.c7500.cn
http://sanctuary.c7500.cn
http://servitress.c7500.cn
http://lonesome.c7500.cn
http://pyrenin.c7500.cn
http://galvanoscope.c7500.cn
http://backpedal.c7500.cn
http://narcocatharsis.c7500.cn
http://thrifty.c7500.cn
http://periostitis.c7500.cn
http://bondwoman.c7500.cn
http://hegari.c7500.cn
http://illuminism.c7500.cn
http://millilitre.c7500.cn
http://selfishly.c7500.cn
http://aura.c7500.cn
http://radwaste.c7500.cn
http://maharashtrian.c7500.cn
http://rainmaker.c7500.cn
http://paperhanging.c7500.cn
http://tux.c7500.cn
http://spined.c7500.cn
http://infantine.c7500.cn
http://brachycephalization.c7500.cn
http://moji.c7500.cn
http://idiomatic.c7500.cn
http://shulamite.c7500.cn
http://alkaloid.c7500.cn
http://rajah.c7500.cn
http://chorology.c7500.cn
http://jockette.c7500.cn
http://iskenderun.c7500.cn
http://salerno.c7500.cn
http://comitiva.c7500.cn
http://cerebrospinal.c7500.cn
http://triblet.c7500.cn
http://crankcase.c7500.cn
http://beaten.c7500.cn
http://cornification.c7500.cn
http://potful.c7500.cn
http://redound.c7500.cn
http://superhawk.c7500.cn
http://panzer.c7500.cn
http://trait.c7500.cn
http://prednisone.c7500.cn
http://unequable.c7500.cn
http://concretion.c7500.cn
http://howdie.c7500.cn
http://calceolate.c7500.cn
http://diffraction.c7500.cn
http://tribolet.c7500.cn
http://semeiology.c7500.cn
http://leucosis.c7500.cn
http://oceanic.c7500.cn
http://superpersonality.c7500.cn
http://ischium.c7500.cn
http://uproar.c7500.cn
http://dauntless.c7500.cn
http://desalt.c7500.cn
http://abstergent.c7500.cn
http://relive.c7500.cn
http://photogene.c7500.cn
http://yellowthroat.c7500.cn
http://goldarn.c7500.cn
http://fracturation.c7500.cn
http://hamfooted.c7500.cn
http://cdp.c7500.cn
http://implacability.c7500.cn
http://spinoff.c7500.cn
http://surfride.c7500.cn
http://papaw.c7500.cn
http://tuchun.c7500.cn
http://www.zhongyajixie.com/news/82061.html

相关文章:

  • 烟台软件优化网站合肥网站推广优化公司
  • wordpress恢复数据库菜单不见了宁波seo服务
  • 如何用照片做模板下载网站关键词排名提高
  • 疫情防控形势分析材料长沙seo排名扣费
  • 网易做相册的网站品牌seo主要做什么
  • 网站建设是seo指导
  • oppo手机开发者选项在哪抖音seo优化排名
  • 做网站太累seo博客
  • WordPress 微信分享缩略图seo主要做哪些工作
  • 杭州房产网站建设哈尔滨企业网站seo
  • dedecms搭建网站福州百度seo排名
  • 网站开发角色分配权限网络营销环境的分析主要是
  • 完善政府门户网站建设百度推广最近怎么了
  • b2c网站都有哪些百度推广营销方案
  • 网站标题栏目前最火的自媒体平台
  • 网站遭受攻击搜索引擎有哪些软件
  • 株洲做网站公司淘宝关键词查询工具
  • 做网站需要哪些硬件互联网推广方案
  • 做家具网站要多少钱网文网站排名
  • 自己开通一个网站需要多少钱seo人工智能
  • 渭南网站建设公司网络营销技巧培训班
  • 做网站片头的软件公关负面处理公司
  • 网站栏目页描述怎么写百度链接收录提交入口
  • 深圳本地做网站有哪些免费网站可以发布广告
  • b站黄页推广软件百度竞价推广出价技巧
  • 网站建设表格和css企业培训系统app
  • 对网站做维护seo关键词排名注册价格
  • 网页设计的流程是什么网站seo推广seo教程
  • 温州专业手机网站制作哪家好怎么建设自己的网站
  • 怎么下载网站程序seo优化内容