Let G V E be a directed weighted graph and let us assume th
Let G = (V, E) be a directed, weighted graph and let us assume that the main operation that we are interested in is to determine whether two vertices are connected by an edge in G. Which data structure should be used to represent the graph G such that this operation is implemented efficiently?
A) adjacency-matrix graph representation
B) Binary Search Tree representation
C) adjacency-list graph representation
D) we cannot represent such a graph G
Solution
Answer: Option: A) adjacency-matrix graph representation
