>深度优先遍历: DFS(英语:Depth-First-Search,DFS) 是一种用于遍历或搜索树或图的算法 ```javascript const node = { name: "node 1", children: [] }; function DFS(node) { console.log("探寻", node.name); node.children.forEach(child => { DFS(child); }); console.log("回溯", node.name); } ```