G
having
n
vertices and m
edges with the edge list
structure. Why, in this case, does the insertVertex
method
run in O(1)
time while the removeVertex
method
runs in O(m)
time? Statement and proof of complexity required.
getEdge(u, v)
as fast as
possible, no matter how much space you use.n
-vertex graph
G
using the edge list structure, assuming that we identify the
vertices with the integers in the set {0, 1, ..., n - 1}
.
Describe how to implement the collection E
to support
O(log n)
-time performance for the getEdge(u, v)
method. How are you implementing the method in this case?