Question: Suppose we represent a graph G having n vertices and m edges with the edge list structure. Why, in this case, does the insertVertex function
Suppose we represent a graph G having n vertices and m edges with the edge list structure. Why, in this case, does the insertVertex function run in O(1) time while the eraseVertex function runs in O(m) time?
Step by Step Solution
3.40 Rating (172 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
