#include <leetcode.h>
|
static void | dfs (const vector< string > ¤t, const string &s, vector< vector< string > > &ans, int start, int cursor) |
|
static bool | is_palindromic (const string &s, int start, int end) |
|
static vector< vector< string > > | partition (const string &s) |
|
◆ dfs()
void leetcode::palindrome_partitioning::Solution::dfs |
( |
const vector< string > & |
current, |
|
|
const string & |
s, |
|
|
vector< vector< string > > & |
ans, |
|
|
int |
start, |
|
|
int |
cursor |
|
) |
| |
|
static |
在文件 leetcode.cpp 第 8858 行定义.
8859 if(cursor == s.length() - 1 &&
is_palindromic(s, start, cursor)) {
8860 ans.emplace_back(current);
8861 ans.back().emplace_back(s.substr(start, cursor - start + 1));
8864 if(cursor >= s.length() - 1 || start >= s.length()) {
8868 vector next = current;
8869 next.emplace_back(s.substr(start, cursor - start + 1));
8870 dfs(next, s, ans, cursor + 1, cursor + 1);
8872 dfs(current, s, ans, start, cursor + 1);
static void dfs(const vector< string > ¤t, const string &s, vector< vector< string > > &ans, int start, int cursor)
static bool is_palindromic(const string &s, int start, int end)
引用了 dfs() , 以及 is_palindromic().
被这些函数引用 dfs() , 以及 partition().
◆ is_palindromic()
bool leetcode::palindrome_partitioning::Solution::is_palindromic |
( |
const string & |
s, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
|
static |
◆ partition()
vector< vector< string > > leetcode::palindrome_partitioning::Solution::partition |
( |
const string & |
s | ) |
|
|
static |
该类的文档由以下文件生成: