#include <leetcode.h>
|
static vector< vector< int > > | allPathsSourceTarget (vector< vector< int > > &graph) |
|
static int | dfs (vector< vector< int > > &graph, vector< vector< int > > &ans, int cur) |
|
◆ allPathsSourceTarget()
vector< vector< int > > leetcode::all_paths_from_source_to_target::Solution::allPathsSourceTarget |
( |
vector< vector< int > > & |
graph | ) |
|
|
static |
在文件 leetcode.cpp 第 6407 行定义.
6408 vector<vector<int>> ans;
6410 for(
auto &path: ans) {
6412 path = vector(path.rbegin(), path.rend());
static int dfs(vector< vector< int > > &graph, vector< vector< int > > &ans, int cur)
引用了 dfs().
◆ dfs()
int leetcode::all_paths_from_source_to_target::Solution::dfs |
( |
vector< vector< int > > & |
graph, |
|
|
vector< vector< int > > & |
ans, |
|
|
int |
cur |
|
) |
| |
|
static |
在文件 leetcode.cpp 第 6417 行定义.
6419 if(cur == graph.size() - 1) {
6420 ans.emplace_back(vector(1, cur));
6423 for(
const auto next: graph[cur]) {
6424 const int n =
dfs(graph, ans, next);
6426 for(
int i = ans.size() - 1, j = 0; j < n; i--, j++) {
6427 ans[i].emplace_back(cur);
引用了 dfs().
被这些函数引用 allPathsSourceTarget() , 以及 dfs().
该类的文档由以下文件生成: