---
title: "#trie articles | Hashnode"
description: "Explore 32 articles tagged #trie on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/trie"
---

Tag

# #trie

32 posts · 1 followers

[Abstract Algorithms](https://hashnode.com/@abstractalgorithms) · [Mar 13](https://hashnode.com/posts/system-design-hld-search-autocomplete-example/69b44d83dc493d4d2714b6a6)

### [System Design HLD Example: Search Autocomplete (Google/Amazon)](https://abstractalgorithms.hashnode.dev/system-design-hld-search-autocomplete-example?utm_source=hashnode&utm_medium=feed)

Sub-10ms prefix lookup, ranking, typo tolerance, and language-partitioned indexes at Google scale.

15 min read · [abstractalgorithms.hashnode.dev](https://abstractalgorithms.hashnode.dev/system-design-hld-search-autocomplete-example?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jan 17](https://hashnode.com/posts/maximum-xor-with-an-element-from-array/696bd54bf0cfe5e927abfcc7)

### [Maximum XOR With an Element From Array](https://chetan77.hashnode.dev/maximum-xor-with-an-element-from-array?utm_source=hashnode&utm_medium=feed)

Problem You are given an array nums consisting of non-negative integers. You are also given a queries array, where queries\[i\] = \[x<sub>i</sub>, m<sub>i</sub>\]. (link) The answer to the i<sup>th</sup> query is the maximum bitwise XOR value of x<sub>i<...

3 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/maximum-xor-with-an-element-from-array?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jan 15](https://hashnode.com/posts/maximum-xor-of-two-numbers-in-an-array/69690349d264bb6cff78f2e0)

### [Maximum XOR of Two Numbers in an Array](https://chetan77.hashnode.dev/maximum-xor-of-two-numbers-in-an-array?utm_source=hashnode&utm_medium=feed)

Problem Given an integer array nums, return the maximum result of nums\[i\] XOR nums\[j\], where 0 <= i <= j < n. (link) Example 1: Input: nums = \[3,10,5,25,2,8\] Output: 28 Explanation: The maximum result is 5 XOR 25 = 28. Example 2: Input: nums = \[14,7...

2 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/maximum-xor-of-two-numbers-in-an-array?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jan 15](https://hashnode.com/posts/count-of-distinct-substrings/6968bd23c8bdbabc51593f73)

### [Count of distinct substrings](https://chetan77.hashnode.dev/count-of-distinct-substrings?utm_source=hashnode&utm_medium=feed)

Problem Given a string s consisting of lowercase English characters, determine the total number of distinct non-empty substrings present in the string. A substring is defined as a contiguous block of characters within the string. Two substrings are c...

2 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/count-of-distinct-substrings?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jan 15](https://hashnode.com/posts/longest-valid-word-with-all-prefixes/69688892d5bc7829c1b98b90)

### [Longest Valid Word with All Prefixes](https://chetan77.hashnode.dev/longest-valid-word-with-all-prefixes?utm_source=hashnode&utm_medium=feed)

Problem Given an array of strings words\[\], find the longest string such that every prefix of it is also present in words\[\]. If multiple strings have the same maximum length, return the lexicographically smallest one. (link) If no such string is found...

2 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/longest-valid-word-with-all-prefixes?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jan 11](https://hashnode.com/posts/implement-trie-ll/6963ec1576dab021ae9dcb8e)

### [Implement Trie ll](https://chetan77.hashnode.dev/implement-trie-ll?utm_source=hashnode&utm_medium=feed)

Problem Ninja has to implement a data structure ”TRIE” from scratch. Ninja has to complete some functions. 1) Trie(): Ninja has to initialize the object of this “TRIE” data structure. 2) insert(“WORD”): Ninja has to insert the string “WORD” into th...

3 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/implement-trie-ll?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jan 4](https://hashnode.com/posts/implement-trie/695a531ee68a28ba67c4ec2c)

### [Implement Trie I](https://chetan77.hashnode.dev/implement-trie?utm_source=hashnode&utm_medium=feed)

Problem A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker. (link) Imp...

3 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/implement-trie?utm_source=hashnode&utm_medium=feed)

[MrHe](https://hashnode.com/@MrHe) · [Oct 3, 2025](https://hashnode.com/posts/trie-1/68dfd544044674b7e25786fd)

### [字典树（Trie）](https://xiaoh.hashnode.dev/trie-1?utm_source=hashnode&utm_medium=feed)

一提到字符串相关的问题，尤其是涉及前缀匹配的，很多人的第一反应可能是哈希表，或者直接用字符串的 startsWith 方法循环遍历。这些方法当然可以，但一旦数据量上来，或者查询变得频繁，性能问题就暴露无遗了。今天，我们就从这个痛点出发，一步步揭开字典树的神秘面纱，看看它是如何优雅地解决这类问题的。 故事的开始：一个简单的需求 我们先来看一个具体的需求。假设我们正在开发一个搜索框的输入提示功能。我们需要实现这么几个 API： insert(String word): 添加一个新的词到我们的词库里...

3 min read · [xiaoh.hashnode.dev](https://xiaoh.hashnode.dev/trie-1?utm_source=hashnode&utm_medium=feed)

[Varad Gupta](https://hashnode.com/@vr-varad) · [Sep 7, 2025](https://hashnode.com/posts/designing-a-toy-search-engine-with-trie-and-tf-idf/68bd6a8b501f8681afe44958)

### [Designing a Toy Search Engine with Trie and TF-IDF](https://404osaurs.hashnode.dev/designing-a-toy-search-engine-with-trie-and-tf-idf?utm_source=hashnode&utm_medium=feed)

A search engine, as the name suggests, is a tool that helps you search through your content. It efficiently retrieves relevant information from a vast pool of data, allowing users to find specific documents, web pages, or files quickly. By indexing c...

10 min read · [404osaurs.hashnode.dev](https://404osaurs.hashnode.dev/designing-a-toy-search-engine-with-trie-and-tf-idf?utm_source=hashnode&utm_medium=feed)

[Somenath Mukhopadhyay](https://hashnode.com/@som-itsolutions) · [Aug 19, 2025](https://hashnode.com/posts/arranging-the-words-of-an-input-text-lexicographically/68a3d0c60f68eef7ae2fa24a)

### [Arranging the words of an input text Lexicographically...](https://som-itsolutions.hashnode.dev/arranging-the-words-of-an-input-text-lexicographically?utm_source=hashnode&utm_medium=feed)

https://docs.google.com/document/d/1Vpx\_fwPMwcaDy1DLQxH9\_qlU8J7-znZQBt6nDAP51rI/edit?usp=sharing

1 min read · [som-itsolutions.hashnode.dev](https://som-itsolutions.hashnode.dev/arranging-the-words-of-an-input-text-lexicographically?utm_source=hashnode&utm_medium=feed)
