Data Structure Questions and Answers-Adjacency List

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Data Structure Questions and Answers-Adjacency List

Question 1
Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is .....
A
O(E)
B
O(V*V)
C
O(E+V)
D
O(V)
Economics Questions answers
Question 1 Explanation: 
In an adjacency list for every vertex there is a linked list which have the values of the edges to which it is connected.

Question 2
For some sparse graph an adjacency list is more space efficient against an adjacency matrix.
A
True
B
False
Visual arts Questions answers
Question 2 Explanation: 
Space complexity for adjacency matrix is always O(V*V) while space complexity for adjacency list in this case would be O(V).

Question 3
Time complexity to find if there is an edge between 2 particular vertices is .....
A
O(V)
B
O(E)
C
O(1)
D
O(V+E)
Reading comprehension Questions answers
Question 3 Explanation: 
The maximum edges a vertex can have is V-1.

Question 4
For the given conditions, which of the following is in the correct order of increasing space requirement?

i) Undirected, no weight

ii) Directed, no weight

iii) Directed, weighted

iv) Undirected, weighted

A
ii iii i iv
B
i iii ii iv
C
iv iii i ii
D
i ii iii iv
English grammar Questions answers
Question 4 Explanation: 
i) takes v+4e, ii) takes v+2e, iii) takes v+3e, iv) takes v +6e space.

Question 5
Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is .....
A
O(V)
B
O(E*E)
C
O(E)
D
O(E+V)
UPSC test Questions answers
Question 5 Explanation: 
In an adjacency list for every vertex there is a linked list which have the values of the edges to which it is connected.

There are 5 questions to complete.

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<