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

Автор danger1200, 7 лет назад, перевод, По-русски

Today I noticed some interesting facts about dfs and bfs algorithms.

Let's consider a complete graph consisting of N vertices. Do bfs and dfs algorithms over this graph. You may be surprised but the spanning tree formed by BFS algorithm looks like a sun so I called this tree "Solnyshko-tree" while the tree formed by DFS algorithms looks like a line so I called it "Bamboooo-tree".

For a better understanding I suggest you to have a look at provided pictures.

Hope you find this topic interesting and useful. Thanks for attention and good luck on the upcoming contest!

Полный текст и комментарии »

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