Блог пользователя XNight_KingX

Автор XNight_KingX, история, 7 лет назад, По-английски

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>> :)

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

No, it's your output -1, but jury says it is bipartite

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

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>> :)

In general there is no difference, use what is comfortable to implement.