当前位置:网站首页>Data Organization---Chapter 6 Diagram---Graph Traversal---Multiple Choice Questions

Data Organization---Chapter 6 Diagram---Graph Traversal---Multiple Choice Questions

2022-08-02 14:01:00 A life without a root, gone with the wind, such as dust on the

1What is the single-source shortest path problem

Given a starting point in the graph, find the shortest distance from the starting point to other vertices.
When the weights of each edge are equal, the breadth-first algorithm can solve the single-source shortest path problem
But not when the weights are not equal, because the breadth-first algorithm does not consider the weights, it only considers the number of edges.

2 Breadth-first traversal is similar to level-order traversal in a tree, and depth-first search traversal is similar to pre-order traversal in a tree.

3 Breadth-first search requires a queue, and depth-first search requires a stack.

4 For a non-connected undirected graph G, using depth-first traversal to access all vertices, the number of calls to DFS in the DFSTraverse function is exactly equal to?

5 Breadth First Search Spanning Tree for Graph, Depth First Search Spanning Tree for Graph

insert image description here

原网站

版权声明
本文为[A life without a root, gone with the wind, such as dust on the ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208021351337973.html