Suppose a graph data structure is used to represent direct travel links between cities.   Nodes in the graph represent cities and there is an undirected edge from city X to city Y if it is possible to travel directly between those two cities.    If the primary use of this graph is to query whether direct travel between two cities is possible, which graph data structure would be more efficient in terms of the time required to complete the query?    单项选择题

A

Adjacency Matrix

B

Adjacency List

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

类似问题

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!