Computer Science, asked by krinam8493, 10 months ago

How to find if a graph is Bipartite?

Answers

Answered by brainism
0

Check if a given graph is Bipartite using DFS

Use a color[] array which stores 0 or 1 for every node which denotes opposite colors.

Call the function DFS from any node.

If the node u has not been visited previously, then assign !color[v] to color[u] and call DFS again to visit nodes connected to u.

hope it will help you

Similar questions