which one is better for bipartition check BFS or DFS? I think DFS is better but not able to Deduce this intuition clearly? can you help me with that. Noobie here, pls go less hard>> :)
which one is better for bipartition check BFS or DFS? I think DFS is better but not able to Deduce this intuition clearly? can you help me with that. Noobie here, pls go less hard>> :)
No, it's your output -1, but jury says it is bipartite
In general there is no difference, use what is comfortable to implement.