<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>前綴樹 on BenzHub</title><link>https://benzhub.github.io/tags/%E5%89%8D%E7%B6%B4%E6%A8%B9/</link><description>Recent content in 前綴樹 on BenzHub</description><generator>Hugo</generator><language>zh-TW</language><lastBuildDate>Wed, 24 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://benzhub.github.io/tags/%E5%89%8D%E7%B6%B4%E6%A8%B9/index.xml" rel="self" type="application/rss+xml"/><item><title>字典樹 Trie — 前綴搜尋與自動補全的核心資料結構 | 資料結構與演算法</title><link>https://benzhub.github.io/post/javascript/data-structures--algorithms/011-trie/</link><pubDate>Wed, 24 Jun 2026 00:00:00 +0000</pubDate><guid>https://benzhub.github.io/post/javascript/data-structures--algorithms/011-trie/</guid><description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;字典樹（Trie，又稱前綴樹）&lt;/strong&gt; 是一種專門為字串集合設計的多路樹資料結構，以極高的效率支援&lt;strong&gt;前綴查詢（Prefix Query）&lt;/strong&gt;。插入、搜尋、前綴匹配的時間複雜度皆為 &lt;strong&gt;O(L)&lt;/strong&gt;（L 為字串長度），完全不受字典大小影響。理解 Trie 是掌握搜尋引擎自動補全、拼字檢查與路由演算法的關鍵。&lt;/p&gt;
&lt;/blockquote&gt;</description></item></channel></rss>