#include <leetcode.h>
◆ TrieNode() [1/2]
leetcode::UhWRSj::TrieNode::TrieNode |
( |
| ) |
|
|
inline |
◆ TrieNode() [2/2]
leetcode::UhWRSj::TrieNode::TrieNode |
( |
char | ch | ) |
|
|
inlineexplicit |
◆ get_prefix()
string TrieNode::get_prefix |
( |
string | root, |
|
|
const string & | str ) const |
|
nodiscard |
在文件 leetcode.cpp 第 1293 行定义.
1293 {
1294 if(this->
endroot || str.empty()) {
1296 }
1297 if(this->
next[str[0] -
'a'] ==
nullptr) {
1299 }
1300 return this->
next[str[0] -
'a']->get_prefix(root + str[0], str.substr(1));
1301 }
引用了 endroot , 以及 next.
◆ insert()
void TrieNode::insert |
( |
const string & | str | ) |
|
在文件 leetcode.cpp 第 1282 行定义.
1282 {
1283 if(str.empty()) {
1285 return;
1286 }
1287 if(this->
next[str[0] -
'a'] ==
nullptr) {
1289 }
1290 this->
next[str[0] -
'a']->insert(str.substr(1));
1291 }
引用了 TrieNode(), endroot , 以及 next.
◆ ch
char leetcode::UhWRSj::TrieNode::ch |
◆ endroot
bool leetcode::UhWRSj::TrieNode::endroot |
◆ next
TrieNode* leetcode::UhWRSj::TrieNode::next[26] = {} |
该结构体的文档由以下文件生成: