图论26(Leetcode785判断二分图)

代码:

class Solution {
    public int[] color;
    public boolean valid;
    public boolean isBipartite(int[][] graph) {
        color = new int[graph.length];
        valid = true;
        for(int i=0;i

你可能感兴趣的:(图论,算法,深度优先)