【发布时间】:2014-05-14 17:16:10
【问题描述】:
我有一个问题说
Let a directed graph G model a relation R. If G is represented using adjacency lists, then,
the worst case time complexity for finding whether R is symmetric would be (as a
function of |R| ) _____?
根据我的答案,要查找是否满足对称属性,我们只需要访问两个顶点并检查它们是否都在彼此的邻接列表中。
所以,最坏的情况是 O(degree(vertex)) 但给出的答案是 O(|R|*|R|) 或 O(|E|*|E|)
如何?
【问题讨论】:
标签: data-structures graph complexity-theory relation