第一,我不是大姐铪。
第二,正确的翻译如下:Figure is a complex data structure, the relationship between its nodes can be arbitrary, map between any two elements are likely to be relevant, which in many applications are widely used. Graph theory is to examine the map of related knowledge a science to solve many practical problems are a powerful tool, graph traversal and its implementation are graph theory, one of the basic problem, which is necessary to study the problem in this article.
The paper first briefly introduce the graph theory and application of the course of development; then analyzes the graph depth-first and breadth-first traversal algorithm; On this basis, the use of C language development environment for Win-Tc in the implementation of the plan two traversal algorithm programming implementation.
The main implementation include: 1) input from the keyboard on the vertex and edge map, or randomly generate a map, 2) using two-dimensional array to store the graph adjacency matrix and adjacency matrix displayed on the computer screen, 3) the use of depth priority or breadth-first traversal algorithm traversal algorithm to derive the corresponding vertex traversal order, then use the mapping function traversal sequence of graphical presentation.
Keywords: graph theory; depth-first traversal; breadth-first traversal; adjacency matrix;
Pick to
Graph is a kind of complex data structure, the relationship between the nodes can be arbitrarily, between any two elements in May, and in many applications are used widely. The graph theory is the study of the knowledge map is a subject, a powerful tool for many practical problems, and realize the traversal graph theory is one of the basic questions, this is also the paper to study.
This paper briefly introduces the development course of graph theory and application, Then it analyses the graph depth-first and breadth-first traversing algorithm, On this basis, using C language in to realize the development environment of Tc graph traversing algorithm of two kinds of programming.
The main contents include: 1) from the keyboard input figure of vertex and edge, or a graph randomly generated, 2) using a 2d array to store the adjacency matrix, and the figure shows the adjacency matrix in computer screen, 3) using depth-first traversing algorithm or breadth-first traversing algorithm corresponding vertex traverse sequence, then use graphics functions traverse graphical demonstration.
Keywords: graph, Depth-first traversal, Breadth-first traversal, The adjacency matrix,
Abstract the chart is one kind of complex construction of data, between its node's relations may be random, in the chart between the random two elements possibly is related, thus obtains the widespread application in many application domains. The graph theory is studies the chart related knowledge a knowledge, is solves many actual problem powerful tools, the chart traversal and realizes is one of graph theory basic questions, this is also precisely the question which this article needs to study. this article first briefly introduced the graph theory development process and the application; Then analyzed the chart depth first first traversal the algorithm with the breadth; Based on this, used the C language to realize Figure two kind of traversal algorithm programming in the Win-Tc development environment to realize. mainly realizes the content includes: 1) inputs the chart from the keyboard the apex and side, or produces a chart stochastically, 2) uses the two-dimension array to save the chart the adjacent matrix, and the adjacent matrix demonstration in the computer screen, 3) first traversal using the depth the algorithm or the breadth first traversal the algorithm to extract the corresponding apex traversal order, then the use cartography function carries on the traversal order the presente in figures and diagrams demonstration. key word: Graph theory; The depth first traversal; The breadth first traversal; Adjacent matrix;