[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"article-trieshujieshao":3},{"id":4,"title":5,"slug":6,"summary":7,"content":8,"contentHtml":9,"wordCount":10,"readingTime":11,"categoryId":12,"tags":13,"coverImage":13,"thumbnail":13,"status":14,"isTop":15,"isRecommended":15,"allowComments":15,"password":13,"viewCount":16,"likeCount":15,"commentCount":15,"seoTitle":5,"seoKeywords":17,"seoDescription":18,"source":13,"sourceUrl":13,"publishTime":19},"2010884680939794434","Trie树介绍","trieshujieshao","### 🌲 Trie树的核心特性 Trie树有三个基本性质： 1. **根节点不包含字符**，它作为所有字符串的起点。 2. 从根节点到任意一个节点的路径上，经过的所有字符连接起来，就是该节点对应的字符串（或前缀）。 3. 每个节点的所有子节点所包含的字符都互不相同。 它的核心思想是 **空间换时间**，通过将字符串的公共前缀合并存储，避免了大量无谓的字符串比较，使得查询效率在很多情况下优于哈希表。 ### 🧱 结构与基本操作 一个典型的Trie树节点（TrieNode）通常包含两部分信息： * **子节点指针**：可以是固定大小的数组（如处理26个小写英文字母时使用长度为26的数组）或更灵活的映射（如`Map`），用于指向下一个字符节点。 * **结束标记**：一个布尔值（如`isEndOfWord`），标记从根节点到当前节点的路径是否构成了一个完整的单词（而不仅仅是前缀）。...","### 🌲 Trie树的核心特性\n\nTrie树有三个基本性质：\n1.  **根节点不包含字符**，它作为所有字符串的起点。\n2.  从根节点到任意一个节点的路径上，经过的所有字符连接起来，就是该节点对应的字符串（或前缀）。\n3.  每个节点的所有子节点所包含的字符都互不相同。\n\n它的核心思想是 **空间换时间**，通过将字符串的公共前缀合并存储，避免了大量无谓的字符串比较，使得查询效率在很多情况下优于哈希表。\n\n### 🧱 结构与基本操作\n\n一个典型的Trie树节点（TrieNode）通常包含两部分信息：\n*   **子节点指针**：可以是固定大小的数组（如处理26个小写英文字母时使用长度为26的数组）或更灵活的映射（如`Map\u003CCharacter, TrieNode>`），用于指向下一个字符节点。\n*   **结束标记**：一个布尔值（如`isEndOfWord`），标记从根节点到当前节点的路径是否构成了一个完整的单词（而不仅仅是前缀）。\n\n对Trie树的基本操作包括：\n\n| 操作 | 过程描述 |\n| :--- | :--- |\n| **插入** | 从根节点开始，逐个字符处理待插入字符串。若某个字符在当前节点的子节点中不存在，则创建新的对应子节点。字符串所有字符处理完毕后，在最后一个节点上设置结束标记。 |\n| **查找（精确匹配）** | 从根节点开始，逐个字符向下匹配。若在某个字符处找不到对应子节点，则说明字符串不存在。成功匹配所有字符后，还需检查最后一个节点的结束标记是否为真，以确认是完整单词而非前缀。 |\n| **前缀查询** | 过程与查找类似，但只需成功匹配前缀字符串的所有字符即可返回真，无需检查结束标记。 |\n| **删除** | 首先查找到待删除单词的末端节点，清除其结束标记。如果该节点没有其他子节点，则可以回溯删除不再被其他单词共享的节点，直到遇到共享节点或单词结束节点为止。 |\n\n下面的序列图直观展示了在Trie树中插入单词 \"app\" 和 \"apple\" 的过程，以及共享前缀的特点：\n\n```mermaid\nsequenceDiagram\n    participant A as 调用者\n    participant R as 根节点(Root)\n    participant N1 as 节点(a)\n    participant N2 as 节点(p)\n    participant N3 as 节点(p) [标记app结束]\n    participant N4 as 节点(l)\n    participant N5 as 节点(e) [标记apple结束]\n\n    A->>R: 插入单词\"app\"\n    R->>N1: 检查字符'a'，节点存在?\n    N1->>N2: 检查字符'p'，节点存在?\n    N2->>N3: 检查字符'p'，节点存在?\u003Cbr>（不存在则创建）\n    Note over N3: 标记isEndOfWord=true\n\n    A->>R: 插入单词\"apple\"\n    R->>N1: 检查字符'a'，节点存在√\n    N1->>N2: 检查字符'p'，节点存在√\n    N2->>N3: 检查字符'p'，节点存在√\u003Cbr>（共享前缀\"app\"）\n    N3->>N4: 检查字符'l'，节点存在?\u003Cbr>（不存在则创建）\n    N4->>N5: 检查字符'e'，节点存在?\u003Cbr>（不存在则创建）\n    Note over N5: 标记isEndOfWord=true\n```\n\n### 💡 主要应用场景\n\nTrie树独特的结构使其在以下场景中表现优异：\n*   **搜索引擎和输入法的智能提示\u002F自动补全**：可以快速找出所有以特定前缀开头的单词或短语。\n*   **词频统计**：尤其适合统计大量文本中单词的出现频率。\n*   **拼写检查**：快速判断一个单词是否存在于已知词典中。\n*   **字符串排序**：对一组字符串按字典序进行排序。\n*   **作为高级数据结构的基础**：如后缀树和AC自动机（一种多模式匹配算法）常以Trie树为基础构建。\n\n### ⚖️ 优缺点分析\n\n#### 优点\n*   **高效的查询性能**：查找一个长度为 `L` 的字符串是否存在，时间复杂度在最坏情况下也仅为 `O(L)`，与树中存储的字符串总数无关。\n*   **高效的前缀搜索**：非常适合进行前缀匹配查询，这是哈希表等结构不擅长的。\n*   **自带排序功能**：对Trie树进行先序遍历，自然可以得到字典序排列的字符串集合。\n\n#### 缺点\n*   **内存消耗较大**：每个节点都需要存储子节点的指针。特别是采用固定大小数组时，可能会存在大量空闲指针，导致空间利用率不高。这个缺点可以通过使用动态结构（如`HashMap`）或更高级的实现（如双数组Trie）来缓解。\n*   **效率受字符集影响**：如果字符集很大（如处理整个Unicode字符集），数组实现方式就不再适用，通常需要借助映射结构，可能对效率有少许影响。\n\n### 💎 总结\n\nTrie树的核心优势在于**利用字符串的公共前缀来减少查询时间和存储空间**，特别适合用于**大量字符串的存储、检索和前缀匹配**。虽然存在一定的空间消耗，但在处理具有公共前缀的字符串集合时，其查询效率优势明显。\n\n希望这些解释能帮助你透彻地理解Trie树。如果你对具体代码实现或其他细节有进一步兴趣，我们可以继续深入探讨。","\u003Ch3 data-line=\"0\" id=\"🌲 Trie树的核心特性\">🌲 Trie树的核心特性\u003C\u002Fh3>\n\u003Cp data-line=\"2\">Trie树有三个基本性质：\u003C\u002Fp>\n\u003Col data-line=\"3\">\n\u003Cli data-line=\"3\">\u003Cstrong>根节点不包含字符\u003C\u002Fstrong>，它作为所有字符串的起点。\u003C\u002Fli>\n\u003Cli data-line=\"4\">从根节点到任意一个节点的路径上，经过的所有字符连接起来，就是该节点对应的字符串（或前缀）。\u003C\u002Fli>\n\u003Cli data-line=\"5\">每个节点的所有子节点所包含的字符都互不相同。\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp data-line=\"7\">它的核心思想是 \u003Cstrong>空间换时间\u003C\u002Fstrong>，通过将字符串的公共前缀合并存储，避免了大量无谓的字符串比较，使得查询效率在很多情况下优于哈希表。\u003C\u002Fp>\n\u003Ch3 data-line=\"9\" id=\"🧱 结构与基本操作\">🧱 结构与基本操作\u003C\u002Fh3>\n\u003Cp data-line=\"11\">一个典型的Trie树节点（TrieNode）通常包含两部分信息：\u003C\u002Fp>\n\u003Cul data-line=\"12\">\n\u003Cli data-line=\"12\">\u003Cstrong>子节点指针\u003C\u002Fstrong>：可以是固定大小的数组（如处理26个小写英文字母时使用长度为26的数组）或更灵活的映射（如\u003Ccode>Map&lt;Character, TrieNode&gt;\u003C\u002Fcode>），用于指向下一个字符节点。\u003C\u002Fli>\n\u003Cli data-line=\"13\">\u003Cstrong>结束标记\u003C\u002Fstrong>：一个布尔值（如\u003Ccode>isEndOfWord\u003C\u002Fcode>），标记从根节点到当前节点的路径是否构成了一个完整的单词（而不仅仅是前缀）。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp data-line=\"15\">对Trie树的基本操作包括：\u003C\u002Fp>\n\u003Ctable data-line=\"17\">\n\u003Cthead data-line=\"17\">\n\u003Ctr data-line=\"17\">\n\u003Cth style=\"text-align:left\">操作\u003C\u002Fth>\n\u003Cth style=\"text-align:left\">过程描述\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody data-line=\"19\">\n\u003Ctr data-line=\"19\">\n\u003Ctd style=\"text-align:left\">\u003Cstrong>插入\u003C\u002Fstrong>\u003C\u002Ftd>\n\u003Ctd style=\"text-align:left\">从根节点开始，逐个字符处理待插入字符串。若某个字符在当前节点的子节点中不存在，则创建新的对应子节点。字符串所有字符处理完毕后，在最后一个节点上设置结束标记。\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr data-line=\"20\">\n\u003Ctd style=\"text-align:left\">\u003Cstrong>查找（精确匹配）\u003C\u002Fstrong>\u003C\u002Ftd>\n\u003Ctd style=\"text-align:left\">从根节点开始，逐个字符向下匹配。若在某个字符处找不到对应子节点，则说明字符串不存在。成功匹配所有字符后，还需检查最后一个节点的结束标记是否为真，以确认是完整单词而非前缀。\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr data-line=\"21\">\n\u003Ctd style=\"text-align:left\">\u003Cstrong>前缀查询\u003C\u002Fstrong>\u003C\u002Ftd>\n\u003Ctd style=\"text-align:left\">过程与查找类似，但只需成功匹配前缀字符串的所有字符即可返回真，无需检查结束标记。\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr data-line=\"22\">\n\u003Ctd style=\"text-align:left\">\u003Cstrong>删除\u003C\u002Fstrong>\u003C\u002Ftd>\n\u003Ctd style=\"text-align:left\">首先查找到待删除单词的末端节点，清除其结束标记。如果该节点没有其他子节点，则可以回溯删除不再被其他单词共享的节点，直到遇到共享节点或单词结束节点为止。\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp data-line=\"24\">下面的序列图直观展示了在Trie树中插入单词 &quot;app&quot; 和 &quot;apple&quot; 的过程，以及共享前缀的特点：\u003C\u002Fp>\n\u003Cp  data-line=\"26\" class=\"md-editor-mermaid\" data-mermaid-theme=\"light\" data-closed=\"true\" data-processed=\"\" data-content=\"sequenceDiagram\n    participant A as 调用者\n    participant R as 根节点(Root)\n    participant N1 as 节点(a)\n    participant N2 as 节点(p)\n    participant N3 as 节点(p) [标记app结束]\n    participant N4 as 节点(l)\n    participant N5 as 节点(e) [标记apple结束]\n\n    A-&gt;&gt;R: 插入单词&quot;app&quot;\n    R-&gt;&gt;N1: 检查字符'a'，节点存在?\n    N1-&gt;&gt;N2: 检查字符'p'，节点存在?\n    N2-&gt;&gt;N3: 检查字符'p'，节点存在?&lt;br&gt;（不存在则创建）\n    Note over N3: 标记isEndOfWord=true\n\n    A-&gt;&gt;R: 插入单词&quot;apple&quot;\n    R-&gt;&gt;N1: 检查字符'a'，节点存在√\n    N1-&gt;&gt;N2: 检查字符'p'，节点存在√\n    N2-&gt;&gt;N3: 检查字符'p'，节点存在√&lt;br&gt;（共享前缀&quot;app&quot;）\n    N3-&gt;&gt;N4: 检查字符'l'，节点存在?&lt;br&gt;（不存在则创建）\n    N4-&gt;&gt;N5: 检查字符'e'，节点存在?&lt;br&gt;（不存在则创建）\n    Note over N5: 标记isEndOfWord=true\">\u003Csvg aria-roledescription=\"sequence\" role=\"graphics-document document\" viewBox=\"-50 -10 1694.5 894\" style=\"max-width: 1694.5px;\" xmlns:xlink=\"http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxlink\" xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"100%\" id=\"mkbwmeklwp8lcguqlp\">\u003Cg>\u003Crect class=\"actor actor-bottom\" ry=\"3\" rx=\"3\" name=\"N5\" height=\"65\" width=\"195\" stroke=\"#666\" fill=\"#eaeaea\" y=\"808\" x=\"1398.5\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"840.5\" x=\"1496\">\u003Ctspan dy=\"0\" x=\"1496\">节点(e) [标记apple结束]\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg>\u003Crect class=\"actor actor-bottom\" ry=\"3\" rx=\"3\" name=\"N4\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"808\" x=\"1182\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"840.5\" x=\"1257\">\u003Ctspan dy=\"0\" x=\"1257\">节点(l)\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg>\u003Crect class=\"actor actor-bottom\" ry=\"3\" rx=\"3\" name=\"N3\" height=\"65\" width=\"183\" stroke=\"#666\" fill=\"#eaeaea\" y=\"808\" x=\"930.5\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"840.5\" x=\"1022\">\u003Ctspan dy=\"0\" x=\"1022\">节点(p) [标记app结束]\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg>\u003Crect class=\"actor actor-bottom\" ry=\"3\" rx=\"3\" name=\"N2\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"808\" x=\"698\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"840.5\" x=\"773\">\u003Ctspan dy=\"0\" x=\"773\">节点(p)\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg>\u003Crect class=\"actor actor-bottom\" ry=\"3\" rx=\"3\" name=\"N1\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"808\" x=\"449\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"840.5\" x=\"524\">\u003Ctspan dy=\"0\" x=\"524\">节点(a)\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg>\u003Crect class=\"actor actor-bottom\" ry=\"3\" rx=\"3\" name=\"R\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"808\" x=\"200\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"840.5\" x=\"275\">\u003Ctspan dy=\"0\" x=\"275\">根节点(Root)\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg>\u003Crect class=\"actor actor-bottom\" ry=\"3\" rx=\"3\" name=\"A\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"808\" x=\"0\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"840.5\" x=\"75\">\u003Ctspan dy=\"0\" x=\"75\">调用者\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg>\u003Cline name=\"N5\" stroke=\"#999\" stroke-width=\"0.5px\" class=\"actor-line 200\" y2=\"808\" x2=\"1496\" y1=\"65\" x1=\"1496\" id=\"actor6\">\u003C\u002Fline>\u003Cg id=\"root-6\">\u003Crect class=\"actor actor-top\" ry=\"3\" rx=\"3\" name=\"N5\" height=\"65\" width=\"195\" stroke=\"#666\" fill=\"#eaeaea\" y=\"0\" x=\"1398.5\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"32.5\" x=\"1496\">\u003Ctspan dy=\"0\" x=\"1496\">节点(e) [标记apple结束]\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003Cg>\u003Cline name=\"N4\" stroke=\"#999\" stroke-width=\"0.5px\" class=\"actor-line 200\" y2=\"808\" x2=\"1257\" y1=\"65\" x1=\"1257\" id=\"actor5\">\u003C\u002Fline>\u003Cg id=\"root-5\">\u003Crect class=\"actor actor-top\" ry=\"3\" rx=\"3\" name=\"N4\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"0\" x=\"1182\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"32.5\" x=\"1257\">\u003Ctspan dy=\"0\" x=\"1257\">节点(l)\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003Cg>\u003Cline name=\"N3\" stroke=\"#999\" stroke-width=\"0.5px\" class=\"actor-line 200\" y2=\"808\" x2=\"1022\" y1=\"65\" x1=\"1022\" id=\"actor4\">\u003C\u002Fline>\u003Cg id=\"root-4\">\u003Crect class=\"actor actor-top\" ry=\"3\" rx=\"3\" name=\"N3\" height=\"65\" width=\"183\" stroke=\"#666\" fill=\"#eaeaea\" y=\"0\" x=\"930.5\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"32.5\" x=\"1022\">\u003Ctspan dy=\"0\" x=\"1022\">节点(p) [标记app结束]\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003Cg>\u003Cline name=\"N2\" stroke=\"#999\" stroke-width=\"0.5px\" class=\"actor-line 200\" y2=\"808\" x2=\"773\" y1=\"65\" x1=\"773\" id=\"actor3\">\u003C\u002Fline>\u003Cg id=\"root-3\">\u003Crect class=\"actor actor-top\" ry=\"3\" rx=\"3\" name=\"N2\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"0\" x=\"698\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"32.5\" x=\"773\">\u003Ctspan dy=\"0\" x=\"773\">节点(p)\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003Cg>\u003Cline name=\"N1\" stroke=\"#999\" stroke-width=\"0.5px\" class=\"actor-line 200\" y2=\"808\" x2=\"524\" y1=\"65\" x1=\"524\" id=\"actor2\">\u003C\u002Fline>\u003Cg id=\"root-2\">\u003Crect class=\"actor actor-top\" ry=\"3\" rx=\"3\" name=\"N1\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"0\" x=\"449\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"32.5\" x=\"524\">\u003Ctspan dy=\"0\" x=\"524\">节点(a)\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003Cg>\u003Cline name=\"R\" stroke=\"#999\" stroke-width=\"0.5px\" class=\"actor-line 200\" y2=\"808\" x2=\"275\" y1=\"65\" x1=\"275\" id=\"actor1\">\u003C\u002Fline>\u003Cg id=\"root-1\">\u003Crect class=\"actor actor-top\" ry=\"3\" rx=\"3\" name=\"R\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"0\" x=\"200\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"32.5\" x=\"275\">\u003Ctspan dy=\"0\" x=\"275\">根节点(Root)\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003Cg>\u003Cline name=\"A\" stroke=\"#999\" stroke-width=\"0.5px\" class=\"actor-line 200\" y2=\"808\" x2=\"75\" y1=\"65\" x1=\"75\" id=\"actor0\">\u003C\u002Fline>\u003Cg id=\"root-0\">\u003Crect class=\"actor actor-top\" ry=\"3\" rx=\"3\" name=\"A\" height=\"65\" width=\"150\" stroke=\"#666\" fill=\"#eaeaea\" y=\"0\" x=\"0\">\u003C\u002Frect>\u003Ctext style=\"text-anchor: middle; font-size: 16px; font-weight: 400;\" class=\"actor actor-box\" alignment-baseline=\"central\" dominant-baseline=\"central\" y=\"32.5\" x=\"75\">\u003Ctspan dy=\"0\" x=\"75\">调用者\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003Cstyle>#mkbwmeklwp8lcguqlp{font-family:\"trebuchet ms\",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mkbwmeklwp8lcguqlp .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mkbwmeklwp8lcguqlp .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mkbwmeklwp8lcguqlp .error-icon{fill:#552222;}#mkbwmeklwp8lcguqlp .error-text{fill:#552222;stroke:#552222;}#mkbwmeklwp8lcguqlp .edge-thickness-normal{stroke-width:1px;}#mkbwmeklwp8lcguqlp .edge-thickness-thick{stroke-width:3.5px;}#mkbwmeklwp8lcguqlp .edge-pattern-solid{stroke-dasharray:0;}#mkbwmeklwp8lcguqlp .edge-thickness-invisible{stroke-width:0;fill:none;}#mkbwmeklwp8lcguqlp .edge-pattern-dashed{stroke-dasharray:3;}#mkbwmeklwp8lcguqlp .edge-pattern-dotted{stroke-dasharray:2;}#mkbwmeklwp8lcguqlp .marker{fill:#333333;stroke:#333333;}#mkbwmeklwp8lcguqlp .marker.cross{stroke:#333333;}#mkbwmeklwp8lcguqlp svg{font-family:\"trebuchet ms\",verdana,arial,sans-serif;font-size:16px;}#mkbwmeklwp8lcguqlp p{margin:0;}#mkbwmeklwp8lcguqlp .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mkbwmeklwp8lcguqlp text.actor&gt;tspan{fill:black;stroke:none;}#mkbwmeklwp8lcguqlp .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mkbwmeklwp8lcguqlp .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mkbwmeklwp8lcguqlp .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mkbwmeklwp8lcguqlp #arrowhead path{fill:#333;stroke:#333;}#mkbwmeklwp8lcguqlp .sequenceNumber{fill:white;}#mkbwmeklwp8lcguqlp #sequencenumber{fill:#333;}#mkbwmeklwp8lcguqlp #crosshead path{fill:#333;stroke:#333;}#mkbwmeklwp8lcguqlp .messageText{fill:#333;stroke:none;}#mkbwmeklwp8lcguqlp .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mkbwmeklwp8lcguqlp .labelText,#mkbwmeklwp8lcguqlp .labelText&gt;tspan{fill:black;stroke:none;}#mkbwmeklwp8lcguqlp .loopText,#mkbwmeklwp8lcguqlp .loopText&gt;tspan{fill:black;stroke:none;}#mkbwmeklwp8lcguqlp .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mkbwmeklwp8lcguqlp .note{stroke:#aaaa33;fill:#fff5ad;}#mkbwmeklwp8lcguqlp .noteText,#mkbwmeklwp8lcguqlp .noteText&gt;tspan{fill:black;stroke:none;}#mkbwmeklwp8lcguqlp .activation0{fill:#f4f4f4;stroke:#666;}#mkbwmeklwp8lcguqlp .activation1{fill:#f4f4f4;stroke:#666;}#mkbwmeklwp8lcguqlp .activation2{fill:#f4f4f4;stroke:#666;}#mkbwmeklwp8lcguqlp .actorPopupMenu{position:absolute;}#mkbwmeklwp8lcguqlp .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 \u002F 0.4));}#mkbwmeklwp8lcguqlp .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mkbwmeklwp8lcguqlp .actor-man circle,#mkbwmeklwp8lcguqlp line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mkbwmeklwp8lcguqlp :root{--mermaid-font-family:\"trebuchet ms\",verdana,arial,sans-serif;}\u003C\u002Fstyle>\u003Cg>\u003C\u002Fg>\u003Cdefs>\u003Csymbol height=\"24\" width=\"24\" id=\"computer\">\u003Cpath d=\"M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z\" transform=\"scale(.5)\">\u003C\u002Fpath>\u003C\u002Fsymbol>\u003C\u002Fdefs>\u003Cdefs>\u003Csymbol clip-rule=\"evenodd\" fill-rule=\"evenodd\" id=\"database\">\u003Cpath d=\"M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z\" transform=\"scale(.5)\">\u003C\u002Fpath>\u003C\u002Fsymbol>\u003C\u002Fdefs>\u003Cdefs>\u003Csymbol height=\"24\" width=\"24\" id=\"clock\">\u003Cpath d=\"M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z\" transform=\"scale(.5)\">\u003C\u002Fpath>\u003C\u002Fsymbol>\u003C\u002Fdefs>\u003Cdefs>\u003Cmarker orient=\"auto-start-reverse\" markerHeight=\"12\" markerWidth=\"12\" markerUnits=\"userSpaceOnUse\" refY=\"5\" refX=\"7.9\" id=\"arrowhead\">\u003Cpath d=\"M -1 0 L 10 5 L 0 10 z\">\u003C\u002Fpath>\u003C\u002Fmarker>\u003C\u002Fdefs>\u003Cdefs>\u003Cmarker refY=\"4.5\" refX=\"4\" orient=\"auto\" markerHeight=\"8\" markerWidth=\"15\" id=\"crosshead\">\u003Cpath style=\"stroke-dasharray: 0, 0;\" d=\"M 1,2 L 6,7 M 6,2 L 1,7\" stroke-width=\"1pt\" stroke=\"#000000\" fill=\"none\">\u003C\u002Fpath>\u003C\u002Fmarker>\u003C\u002Fdefs>\u003Cdefs>\u003Cmarker orient=\"auto\" markerHeight=\"28\" markerWidth=\"20\" refY=\"7\" refX=\"15.5\" id=\"filled-head\">\u003Cpath d=\"M 18,7 L9,13 L14,7 L9,1 Z\">\u003C\u002Fpath>\u003C\u002Fmarker>\u003C\u002Fdefs>\u003Cdefs>\u003Cmarker orient=\"auto\" markerHeight=\"40\" markerWidth=\"60\" refY=\"15\" refX=\"15\" id=\"sequencenumber\">\u003Ccircle r=\"6\" cy=\"15\" cx=\"15\">\u003C\u002Fcircle>\u003C\u002Fmarker>\u003C\u002Fdefs>\u003Cg>\u003Crect class=\"note\" height=\"39\" width=\"197\" stroke=\"#666\" fill=\"#EDF2AE\" y=\"304\" x=\"923.5\">\u003C\u002Frect>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"noteText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"309\" x=\"1022\">\u003Ctspan x=\"1022\">标记isEndOfWord=true\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg>\u003Crect class=\"note\" height=\"39\" width=\"197\" stroke=\"#666\" fill=\"#EDF2AE\" y=\"749\" x=\"1397.5\">\u003C\u002Frect>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"noteText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"754\" x=\"1496\">\u003Ctspan x=\"1496\">标记isEndOfWord=true\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"80\" x=\"174\">插入单词\"app\"\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"117\" x2=\"271\" y1=\"117\" x1=\"76\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"132\" x=\"398\">检查字符'a'，节点存在?\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"169\" x2=\"520\" y1=\"169\" x1=\"276\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"184\" x=\"647\">检查字符'p'，节点存在?\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"221\" x2=\"769\" y1=\"221\" x1=\"525\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"236\" x=\"896\">检查字符'p'，节点存在?\u003C\u002Ftext>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"255\" x=\"896\">（不存在则创建）\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"294\" x2=\"1018\" y1=\"294\" x1=\"774\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"358\" x=\"174\">插入单词\"apple\"\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"395\" x2=\"271\" y1=\"395\" x1=\"76\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"410\" x=\"398\">检查字符'a'，节点存在√\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"453\" x2=\"520\" y1=\"453\" x1=\"276\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"468\" x=\"647\">检查字符'p'，节点存在√\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"511\" x2=\"769\" y1=\"511\" x1=\"525\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"526\" x=\"896\">检查字符'p'，节点存在√\u003C\u002Ftext>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"545\" x=\"896\">（共享前缀\"app\"）\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"593\" x2=\"1018\" y1=\"593\" x1=\"774\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"608\" x=\"1138\">检查字符'l'，节点存在?\u003C\u002Ftext>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"627\" x=\"1138\">（不存在则创建）\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"666\" x2=\"1253\" y1=\"666\" x1=\"1023\">\u003C\u002Fline>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"681\" x=\"1375\">检查字符'e'，节点存在?\u003C\u002Ftext>\u003Ctext style=\"font-size: 16px; font-weight: 400;\" dy=\"1em\" class=\"messageText\" alignment-baseline=\"middle\" dominant-baseline=\"middle\" text-anchor=\"middle\" y=\"700\" x=\"1375\">（不存在则创建）\u003C\u002Ftext>\u003Cline style=\"fill: none;\" marker-end=\"url(#arrowhead)\" stroke=\"none\" stroke-width=\"2\" class=\"messageLine0\" y2=\"739\" x2=\"1492\" y1=\"739\" x1=\"1258\">\u003C\u002Fline>\u003C\u002Fsvg>\u003C\u002Fp>\u003Ch3 data-line=\"51\" id=\"💡 主要应用场景\">💡 主要应用场景\u003C\u002Fh3>\n\u003Cp data-line=\"53\">Trie树独特的结构使其在以下场景中表现优异：\u003C\u002Fp>\n\u003Cul data-line=\"54\">\n\u003Cli data-line=\"54\">\u003Cstrong>搜索引擎和输入法的智能提示\u002F自动补全\u003C\u002Fstrong>：可以快速找出所有以特定前缀开头的单词或短语。\u003C\u002Fli>\n\u003Cli data-line=\"55\">\u003Cstrong>词频统计\u003C\u002Fstrong>：尤其适合统计大量文本中单词的出现频率。\u003C\u002Fli>\n\u003Cli data-line=\"56\">\u003Cstrong>拼写检查\u003C\u002Fstrong>：快速判断一个单词是否存在于已知词典中。\u003C\u002Fli>\n\u003Cli data-line=\"57\">\u003Cstrong>字符串排序\u003C\u002Fstrong>：对一组字符串按字典序进行排序。\u003C\u002Fli>\n\u003Cli data-line=\"58\">\u003Cstrong>作为高级数据结构的基础\u003C\u002Fstrong>：如后缀树和AC自动机（一种多模式匹配算法）常以Trie树为基础构建。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 data-line=\"60\" id=\"⚖️ 优缺点分析\">⚖️ 优缺点分析\u003C\u002Fh3>\n\u003Ch4 data-line=\"62\" id=\"优点\">优点\u003C\u002Fh4>\n\u003Cul data-line=\"63\">\n\u003Cli data-line=\"63\">\u003Cstrong>高效的查询性能\u003C\u002Fstrong>：查找一个长度为 \u003Ccode>L\u003C\u002Fcode> 的字符串是否存在，时间复杂度在最坏情况下也仅为 \u003Ccode>O(L)\u003C\u002Fcode>，与树中存储的字符串总数无关。\u003C\u002Fli>\n\u003Cli data-line=\"64\">\u003Cstrong>高效的前缀搜索\u003C\u002Fstrong>：非常适合进行前缀匹配查询，这是哈希表等结构不擅长的。\u003C\u002Fli>\n\u003Cli data-line=\"65\">\u003Cstrong>自带排序功能\u003C\u002Fstrong>：对Trie树进行先序遍历，自然可以得到字典序排列的字符串集合。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch4 data-line=\"67\" id=\"缺点\">缺点\u003C\u002Fh4>\n\u003Cul data-line=\"68\">\n\u003Cli data-line=\"68\">\u003Cstrong>内存消耗较大\u003C\u002Fstrong>：每个节点都需要存储子节点的指针。特别是采用固定大小数组时，可能会存在大量空闲指针，导致空间利用率不高。这个缺点可以通过使用动态结构（如\u003Ccode>HashMap\u003C\u002Fcode>）或更高级的实现（如双数组Trie）来缓解。\u003C\u002Fli>\n\u003Cli data-line=\"69\">\u003Cstrong>效率受字符集影响\u003C\u002Fstrong>：如果字符集很大（如处理整个Unicode字符集），数组实现方式就不再适用，通常需要借助映射结构，可能对效率有少许影响。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 data-line=\"71\" id=\"💎 总结\">💎 总结\u003C\u002Fh3>\n\u003Cp data-line=\"73\">Trie树的核心优势在于\u003Cstrong>利用字符串的公共前缀来减少查询时间和存储空间\u003C\u002Fstrong>，特别适合用于\u003Cstrong>大量字符串的存储、检索和前缀匹配\u003C\u002Fstrong>。虽然存在一定的空间消耗，但在处理具有公共前缀的字符串集合时，其查询效率优势明显。\u003C\u002Fp>\n\u003Cp data-line=\"75\">希望这些解释能帮助你透彻地理解Trie树。如果你对具体代码实现或其他细节有进一步兴趣，我们可以继续深入探讨。\u003C\u002Fp>\n",2273,7,"0","",2,0,441,"#mkbwmeklwp,节点,lcguqlp,字符串,前缀","🌲 Trie树的核心特性\nTrie树有三个基本性质：\n\n根节点不包含字符，它作为所有字符串的起点。\n从根节点到任意一个节点的路径上，经过的所有字符连接起来，就是该节点对应的字符串（或前缀）。\n每个节点的所有子节点所包含的字符都互不相同。\n\n它的核心思想是 空间换时间，通过将字符串的公共前缀合并存储，避免了大量无谓的字符串比较，使得查询效率在很多情况下优于哈希表。","2026-01-13 09:20:39"]