2 color graph problem. Why dfs and not bfs ?

Правка en1, от hackerbaba, 2020-05-07 12:52:18

Hello again. Just understood graphs. in this, the author gave a solution of dfs.

I was wondering, as to couldn't it be solved with Breadth First Search? Marking each level as one colour, and the other level as the second colour?

I gave a solution with BFS, but it's giving a wrong output.

Could you please help me out?

Теги #graph, #graphs, graphs, dfs, bfs

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский hackerbaba 2020-05-07 12:52:18 557 Initial revision (published)