广度优先搜索BFS、深度优先搜索DFS我要分享

Depth-first search breadth-first search BFS, DFS

matlab dfs 搜索 bfs 深度 广度 优先

关注次数: 328

下载次数: 3

文件大小: 35.40 kB

代码分类: 其他

开发平台: matlab

下载需要积分: 2积分

版权声明:如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

代码描述

中文说明:matlab练习程序(广度优先搜索BFS、深度优先搜索DFS) 如此经典的算法竟一直没有单独的实现过,真是遗憾啊。广度优先搜索在过去实现的二值图像连通区域标记和 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报


English Description:

MATLAB training program (depth-first search breadth-first search BFS, DFS), this classic has no separate implementations of the algorithm, and really sad. Breadth first search in the past connected area in binary images marked minimum spanning tree algorithm and prim were already unconscious when used, depth-first search is used. This will separate the two algorithms because the algorithm itself is nothing to do with the images, so much more pure. Breadth-first search is starting from a particular node, to search for lines connecting all the nodes, in a width direction like extended until there are no repeat loops through all the nodes. Depth-first search from the beginning of any given node, along the search further down the first node, when unable to examine when, back node, then backtracking depth of a node in the other direction search, until all nodes are not repeating traversal. Breadth-first search using a queue as a temporary node repository; a depth-first search can be recursi


代码预览