随笔分类 - 学科竞赛--算法学习 / 深度优先搜索
摘要:《dfs的连通块模型》 这种题目大多是既可以用bfs也可以用dfs来解决的,其实在图的内部进行搜索遍历,对于dfs来说 这种模型不用恢复现场(即回溯) 《dfs的状态转移模型》 这种题目一般是一次变换之后,以整个图的状态为单位进行转换,这时就要恢复现场、 《dfs之搜索顺序》 这种题目即要找到一种搜
阅读全文
摘要:1 Seating of Students 2 2000ms 262144K 3 描述: 4 Students went into a class to write a test and sat in some way. The teacher thought: "Probably they sat
阅读全文