系统结构图 数据结构
What you are going to learn?
你要学什么?
In this article, we learn about the introduction to Graphs in Data Structure and Algorithm.
在本文中,我们将了解图在数据结构和算法中的介绍 。
What are the components in Graph?
图中有哪些组件 ?
Types of the Graphs.
图的类型 。
How we use the Graph data structure?
我们如何使用Graph数据结构?
图形 (Graph)
The graph is an abstract data type in computer science. It maps the value between two data nodes.
该图是计算机科学中的抽象数据类型。 它在两个数据节点之间映射值。
Figure 1.1
图1.1
组件 (Components)
1) Node: In the above example, Graph(Figure 1.1) there is a set of nodes. Nodes basically store values of data types ( int, float etc). In the example A, B, C, D, E, F are the nodes of the graph.
1)节点:在上面的示例Graph(图1.1)中,有一组节点。 节点基本上存储数据类型的值(int,float等)。 在示例中,A,B,C,D,E,F是图的节点。
2) Edge: In the example graph, there is a set of edges in a graph. Edges make a relationship between two nodes or they are a connection between nodes in a graph. In the example e1 , e2, e3, e5, e6 ,e7,e8are the edges in that graph. Edges can be weighted or unweighted. In the case of a weighted edge, each edge is assigned a weight.
2)边:在示例图中,图中有一组边。 边在两个节点之间建立关系,或者它们是图中节点之间的连接。 在示例e1,e2,e3,e5,e6,e7,e8是该图中的边缘。 边缘可以加权或不加权。 在加权边缘的情况下,为每个边缘分配一个权重。
种类 (Types)
There are two types of graphs,
图有两种类型 ,
1) Directed Graph: When all the edges have a direction from one node to another node then the graph is called Directed Graph. (Figure 1.2)
1)有向图:当所有边都有从一个节点到另一个节点的方向时,该图称为有向图。 (图1.2)
Figure 1.2
图1.2
2) Undirected Graph: When all the edges have no direction then it called Undirected Graph. The edges start from one node and go to another node. (Figure 1.1)
2)无向图:当所有边都没有方向时,则称为无向图。 边从一个节点开始,然后转到另一节点。 (图1.1)
Real life Application of graphs:
现实生活中的图形应用:
Building recommendation system for e-commerce websites
建立电子商务网站推荐系统
Facebook friend circle
Facebook好友圈
GPS system Google maps
GPS系统谷歌地图
翻译自: https://www.includehelp.com/data-structure-tutorial/introduction-to-graph.aspx
系统结构图 数据结构