---
title: "Discussion on \"字典树和后缀数组\" | Hashnode"
description: "Discussion on \"字典树和后缀数组\". 14.2 字典树的应用算法设计\n字典树，也叫Trie树或者前缀树，顾名思义，它就是一种专门用来处理字符串前缀的树形结构。每个节点代表一个字符，从根节点到任意一个节点的路径，就构成了一个字符串。它的核心思想就是用空间换时间，利用字符串的公共前缀来降低查询时间的开销。\n14.2.1 实现Trie（前缀树）\n问题描述\n\n实现一个 Trie (前缀树)，包含 insert, search, 和 startsWith 这三个操作。\n\nTrie() 初始化前缀树对象。\n\nvoid insert(String..."
url: "https://hashnode.com/posts/5a2x5yw45qcr5zkm5zco57ya5pww57ue/68e1202ac9f241e22fb8a806"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [字典树和后缀数组](https://xiaoh.hashnode.dev/5a2x5yw45qcr5zkm5zco57ya5pww57ue?utm_source=hashnode&utm_medium=feed)

14.2 字典树的应用算法设计 字典树，也叫Trie树或者前缀树，顾名思义，它就是一种专门用来处理字符串前缀的树形结构。每个节点代表一个字符，从根节点到任意一个节点的路径，就构成了一个字符串。它的核心思想就是用空间换时间，利用字符串的公共前缀来降低查询时间的开销。 14.2.1 实现Trie（前缀树） 问题描述 实现一个 Trie (前缀树)，包含 insert, search, 和 startsWith 这三个操作。 Trie() 初始化前缀树对象。 void insert(String...

Oct 4, 2025 · 9 min read · xiaoh.hashnode.dev  
Read the article

-   [#5a2x5yw45qcr](https://hashnode.com/tag/5a2x5yw45qcr)
-   [#5zco57ya5pww57ue](https://hashnode.com/tag/5zco57ya5pww57ue)

## Written by

[MrHe](https://hashnode.com/@MrHe)

@MrHe

  
[View profile](https://hashnode.com/@MrHe)

河南科技大学-软件工程

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
