<awangdev>785. Is Graph Bipartite_2.java
public boolean isBipartite(int[][] graph) {
        int n = graph.length; 
        Boolean[] states = new Boolean[n];

        for (int i = 0; i < n; i++) { 
            if (states[i] != null) continue; 
            Queue<Integer> queue = new LinkedList<Integer>();
            queue.offer(i);
            states[i] = true;
            while (!queue.isEmpty()) {
                int curr = queue.poll();
                for (int next : graph[curr]) {
                    if (states[next] != null) {
                        if (states[next] == states[curr]) return false;
                        continue;
                    }
                    states[next] = !states[curr];
                    queue.offer(next);
                }
            }
        }
        return true;
    }
public boolean var_0 ( int [ ] [ ] var_1 ) {
  int var_3 = var_1 . length ;
  Boolean [ ] var_5 = new Boolean [ var_3 ] ;
  for ( int var_7 = 0 ;
  var_7 < var_3 ;
  var_7 ++ ) {
    if ( var_5 [ var_7 ] != null ) continue ;
    Queue < Integer > var_12 = new LinkedList < Integer > ( ) ;
    var_12 . offer ( var_7 ) ;
    var_5 [ var_7 ] = true ;
    while ( ! var_12 . isEmpty ( ) ) {
      int var_16 = var_12 . poll ( ) ;
      for ( int var_17 : var_1 [ var_16 ] ) {
        if ( var_5 [ var_17 ] != null ) {
          if ( var_5 [ var_17 ] == var_5 [ var_16 ] ) return false ;
          continue ;
        }
        var_5 [ var_17 ] = ! var_5 [ var_16 ] ;
        var_12 . offer ( var_17 ) ;
      }
    }
  }
  return true ;
}
