danger1200's blog

By danger1200, 5 years ago, In English

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!

Read more »

 
 
 
 
  • Vote: I like it
  • -69
  • Vote: I do not like it