• 注册
    • 今日签到
    • 连续签到

    暂没有数据

  • 管理员
  • ph4nTOMs
  • 冷兔
  • 夏天的尾巴
  • 天邊一只雁
  • Lee
    Lee
  • 疯琰疯语
  • 网上考拉
  • 站长的表哥
    站长的表哥
    多伦多小伙伴
  • -:/
    -:/
    • 查看作者
    • DFS vs BFS

      If N < 20, means the tree is not high, the DFS might be fast.

      If N <200 or 1000, and the tree is deep, the DFS might take an extremely long time to go into one leaf node. At the time, it stores all the info as recursive reading all the data. In such a case when the N is large is really memory consuming. Which is BFS take "every heigh" data at the time, and when it is done, go next.

      If the tree is really wide that "one heigh" can not fit into memory, the BFS might not work. Or you can limit the values read at the time.

      if the tree is really depth, and you want to use the DFS, you might need to limit the depth for search every time.

      If the value you are looking for appears at the tree frequently, you might not want to use BFS.

      纽约州·纽约
    • 0
    • 0
    • 0
    • 296
    • 请登录之后再进行评论

      登录
    • 做任务
    • 返回顶部