TriumphantEggplant's blog

By TriumphantEggplant, history, 7 weeks ago, In English,

I'm new to competitive programming and i only recently learned basic algorithms like bfs and dfs. But i haven't found implementations of these two algorithms outside of mazes or other problems on matrices. Some problems are also tagged dfs and I don't understand how that could be used to solve it. So if anyone has examples or useful links that would be appreciated!

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it

»
7 weeks ago, # |
  Vote: I like it +8 Vote: I do not like it

You can use BFS to find the shortest distance between two things in an unweighted graph, or DFS to find lots of things in a tree, or Strongly Connected/BiConnected Components (SCCs/BCCs) on a graph. Most graph problems use some sort of BFS or DFS.

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it
»
6 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Recently I have written several blog posts based on this. You can check this series