标签:highlight ati false art can coloring rsa first nod
Given an undirected graph, find if it is bipartite or not. Return true or false.
biparty graph = two coloring problem
DFS + coloring customization to implement it
We can do this by marking each node with 0 or 1.The first one we mark with 1, then a node in his list of neighbours with 0,
then a neighbour of the neighbour with 1 and so until we mark all the nodes(and return true)
or we arrive in a node that is 0 and we want to mark it with 1 or viceversa (and we return false).
标签:highlight ati false art can coloring rsa first nod
原文地址:http://www.cnblogs.com/apanda009/p/8016125.html