较浅的节点和较深的节点. [英] shallow nodes and deeper nodes.

查看:75
本文介绍了较浅的节点和较深的节点.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...
我发现在某些教程中广度优先搜索

较浅的节点将扩展为较深的节点.

我真的很困惑他们每个人的含义吗?

谢谢您.

Hi...
I found that in some tutorial the breadth first search

the shallow nodes are expanded befor deeper nodes.

I am realy confuse what is the meaning of each of them?

Thank you

推荐答案

考虑一个树数据结构,其中从根节点开始,树中任何节点的子代数从零到n. BFS会先访问任何节点的所有m个子节点,然后再下降检查下一个更深的层次,而DFS总是在找到一个仍有子节点的节点后立即尝试下降到下一个层次.

干杯!
Consider a tree data structure where starting from the root node there are anything from zero to n children for any node in the tree. BFS just visits all the m children of any node before it descends to inspect the next deeper level while DFS always tries to descend to the next level as soon as it finds a node that still has child nodes.

Cheers!


这篇关于较浅的节点和较深的节点.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆