一般来讲,搜索主要分为两条路bfs和dfs,本节主要研究两种方式搜索一些延申及优化。一、DFS -> 剪枝 -> IDDFS void dfs(int s, int t, int depth) { if (s == t && depth <= n) { //输出答案 return; } if (check(s) || depth > n) //剪枝 return; for (int i = 0;;) { //寻找当前节点的子节点,即树的下一层 int new_s = s + i; //新的状态 if (!vis[new_s])...