哪位大虾能举出这两个算法在实际生活中应用的例子啊?因为一道考题让写,实在想不出~~小弟在此先感激不尽了~

解决方案 »

  1.   

    你可以google一下,我刚才试过了,讲的还算明白!
      

  2.   

    生活中?迷宫不算的话就如那个网络拓扑结构的发现。。当网管的话就知道,各个通路啊路由。交换机,主机。。hub,防火墙等等
      

  3.   

    网络爬虫的时候用到,先用URL种子得到网页,再分析里面的链接,加入到链接列表中,这时就考虑是用广度优先还是深度优先 ,广度优先是先遍历完一个网页中的所有链接,再继续进行
      

  4.   

    Algorithms where DFS() is used:Finding connected components. 
    Topological sorting. 
    Finding 2-(edge or vertex)-connected components. 
    Finding strongly connected components. 
    Solving puzzles with only one solution, such as mazes. (DFS can be adapted to find all solutions to a maze by only including nodes on the current path in the visited set.) 维基上的,我搬过来,深度优先算法的应用
    1. 寻找连通分支
    2. 拓扑排序
    3. 寻找2边连通,或者2点连通
    4. 寻找强连通
    ....
    都是数学应用或者图应用的的比较多吧