+1 vote
in Data Structures & Algorithms I by (88.2k points)
On which of the following statements does the time complexity of checking if an edge exists between two particular vertices is not, depends?

(a) Depends on the number of edges

(b) Depends on the number of vertices

(c) Is independent of both the number of edges and vertices

(d) It depends on both the number of edges and vertices

Asked question is from Adjacency Matrix topic in division Graph of Data Structures & Algorithms I

The question was asked by my college professor while I was bunking the class.

1 Answer

+1 vote
by (737k points)
selected by
 
Best answer
Correct option is (c) Is independent of both the number of edges and vertices

Explanation: To check if there is an edge between to vertices i and j, it is enough to see if the value of A[i][j] is 1 or 0, here A is the adjacency matrix.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...