uf [leetcode] Is Graph Bipartite? node color == adjacent node color must be false for a graph to be a bipartite dfs w/o recursion Time: O(N), iter every node in the graph once and iter its child once Space: O(N), visitedThenColor + stack explanation star... bipartiterecursionBFSDFSufJavaleetcodecolorGraphBFS
[leetcode] Is Graph Bipartite? node color == adjacent node color must be false for a graph to be a bipartite dfs w/o recursion Time: O(N), iter every node in the graph once and iter its child once Space: O(N), visitedThenColor + stack explanation star... bipartiterecursionBFSDFSufJavaleetcodecolorGraphBFS