GATE | GATE MOCK 2017 | Question 47
You are given a graph containing n vertices and m edges and given that the graph doesn’t contain cycle of odd length. Time Complexity of the best known algorithm to find out whether the graph is bipartite or not is ?
(A) O(m+n)
(B) O(1)
(C) O(mn)
(D) O(n2)
Answer: (B)
Explanation:
It is by definition that a graph is bipartite iff it does not contain odd length cycles.
So the answer is O(1).
For more background reading, check this link
https://proofwiki.org/wiki/Graph_is_Bipartite_iff_No_Odd_Cycles
Quiz of this Question
Recommended Posts:
- GATE | GATE 2017 MOCK II | Question 15
- GATE | GATE MOCK 2017 | Question 4
- GATE | GATE MOCK 2017 | Question 5
- GATE | GATE MOCK 2017 | Question 6
- GATE | GATE MOCK 2017 | Question 7
- GATE | GATE MOCK 2017 | Question 8
- GATE | GATE MOCK 2017 | Question 9
- GATE | GATE MOCK 2017 | Question 10
- GATE | GATE MOCK 2017 | Question 11
- GATE | GATE MOCK 2017 | Question 12
- GATE | GATE MOCK 2017 | Question 13
- GATE | GATE MOCK 2017 | Question 14
- GATE | GATE MOCK 2017 | Question 3
- GATE | GATE MOCK 2017 | Question 2
- GATE | GATE 2017 MOCK II | Question 14


