in Graph Theory retagged by
17,715 views
0 votes
0 votes

Which of the following is an advantage of adjacency list representation over adjacency matrix representation of a graph?

  1. In adjacency list representation, space is saved for sparse graphs.
  2. Deleting a vertex in adjacency list representation is easier than adjacency matrix representation.
  3. Adding a vertex in adjacency list representation is easier than adjacency matrix representation.
  4. All of the option.
in Graph Theory retagged by
by
17.7k views

3 Answers

0 votes
0 votes

Answer D

A:  True , Might save a lot of memory if the graph is sparse.

B:  True, In order to delete  a vertex in  adjacency list, we need to search for the vertex which will require O(|V|) time in worst case, after this we need to traverse the edges and in worst case it will require O(|E|) time.Hence, total time complexity is O(|V|+|E|) whereas removing a vertex in adjacency matrix will require O(V$^{2}$)

C :  True , There are two pointers in adjacency list first points to the front node and the other points to the rear node.Thus insertion of a vertex can be done directly in O(1) time whereas in matrix it will require O(V$^{2}$)

0 votes
0 votes
Option D is right

(A) is trivial

(B) and (C) we have to change the dimension of the matrix which takes O(v^2) in case of Adj Matrix  => so these operations are More easier in case of Adj List
edited by
0 votes
0 votes
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true