Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一条带有起点和终点的路线,我希望找出所有的路径,我应该怎么做?
从起始顶点运行DFS,将到目前为止找到的顶点列表传递到下一个调用级别。到达结束顶点时打印列表,并继续使用 DFS 直到枚举完所有路径。