+1 vote
in Data Structures & Algorithms I by (88.2k points)
What would the  time complexity to check if an undirected graph with V vertices and E edges is Bipartite or not given its adjacency matrix?

(a) O(E*E)

(b) O(V*V)

(c) O(E)

(d) O(V)

The origin of the question is Undirected Graph in portion Graph of Data Structures & Algorithms I

I have been asked this question during an interview for a job.

1 Answer

+1 vote
by (737k points)
selected by
 
Best answer
Correct answer is (b) O(V*V)

The best I can explain: A graph can be checked for being Bipartite by seeing if it is 2-colorable or not, which can be obtained with the help of BFS.

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

...