Consider a graph G with 4 vertices and 5 edges.For each of the three graph representations in C from the lecture (array of edges, adjacency matrix, adjacency list), calculate the storage costs for G under the same assumptions as in Exercise 3b. For the array-of-edges representation, assume that memory for the maximum possible number of edges, i.e. V·(V-1)/2, is allocated.How do the representations compare?单项选择题

A

|adjacency-matrix| < |adjacency list| < |array-of-edges|

B

|adjacency-matrix| = |adjacency-list| < |array-of-edges|

C

|adjacency-matrix| < |array-of-edges| < |adjacency-list|

D

|adjacency-matrix| < |array-of-edges| = |adjacency-list|

E

|array-of-edges| = |adjacency-matrix| < |adjacency-list|

登录即可查看完整答案

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

类似问题

更多留学生实用工具

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