Tagged articles
Trie
29 articles · Page 1 of 1
The article walks through the evolution of sensitive‑word filtering—from naïve brute‑force scanning to Trie, Aho‑Corasick automaton, Double‑Array Trie, and DFA implementations—detailing their algorithms, time/space complexities, concrete Java code examples, performance trade‑offs, high‑concurrency optimizations, and practical production advice for building a robust content‑moderation system.
Aho-CorasickDFAJava
0 likes · 26 min read

This article deeply examines the source code of Go’s high‑performance segmentation library gse, revealing its Double‑Array Trie, shortest‑path dynamic programming, and HMM‑Viterbi implementations, and demonstrates practical usage for Chinese tokenization, part‑of‑speech tagging, keyword extraction, and custom dictionary management.
GSEGoHMM
0 likes · 13 min read

This article walks through the layered architecture that large services like Instagram use to instantly check if a username is taken, starting from simple database queries, adding caching, employing Bloom filters, and finally using Trie structures for fast, memory‑efficient lookups.
Bloom FilterCachingTrie
0 likes · 10 min read

Faced with minutes‑long posting delays and exploding review costs in a fast‑growing social app, the team introduced 24‑hour shift staffing, a local blacklist stored in MySQL, an in‑memory Trie + Aho‑Corasick matcher, Redis‑driven hot updates and a machine‑audit fallback with a feedback loop, dramatically cutting latency, cost and false‑positives.
Aho-CorasickContent moderationGo
0 likes · 33 min read

This article explains why traditional string‑search and regex methods struggle with large keyword sets, introduces the deterministic finite automaton (DFA) approach using a Trie structure for linear‑time matching, provides full Java implementations, and discusses real‑world applications and advanced optimizations such as double‑array Tries, Aho‑Corasick, and sharding with Bloom filters.
AlgorithmDFAJava
0 likes · 17 min read

This article explains why traditional string matching and regex struggle with large keyword sets, introduces a DFA‑based solution using a Trie tree for linear‑time detection, provides full Java implementations, shows real‑world integration scenarios, and explores advanced optimizations such as double‑array tries, Aho‑Corasick automata, and sharding with Bloom filters.
AlgorithmDFAJava
0 likes · 17 min read

This article details how to design and implement a scalable, low‑cost content moderation pipeline that combines a local Trie + Aho‑Corasick engine, Redis‑based hot‑updates, MySQL persistence, and third‑party machine‑review fallback to achieve millisecond‑level response, high accuracy, and controllable costs.
Aho-CorasickBackendContent moderation
0 likes · 34 min read

This article analyzes high‑throughput sensitive‑word filtering by comparing brute‑force, KMP, Trie, double‑array Trie and Aho‑Corasick algorithms, presents their time and space complexities, shows Java implementations for Trie and AC automata, evaluates Netty deployment options, and offers practical optimizations such as asynchronous detection, hot‑reloading, tiered responses, logging and fuzzy matching.
Aho-CorasickJavaKMP
0 likes · 37 min read

This article explains the Aho‑Corasick automaton, a classic multi‑pattern matching algorithm that builds a Trie with fail pointers to achieve linear‑time search over massive keyword sets, and demonstrates a Java implementation for highlighting keywords in HTML documents.
Aho-CorasickAlgorithmCode Example
0 likes · 10 min read

This article explains the Aho‑Corasick automaton, detailing its construction, fail‑pointer mechanism, linear‑time complexity, and practical Java implementation for highlighting keywords in HTML, demonstrating its power for massive real‑time text search.
Aho-CorasickAlgorithmJava
0 likes · 10 min read

The article analyzes various Java string‑replacement techniques—including simple String.replace, compiled regular expressions, Aho‑Corasick automaton, and custom Trie implementations—by presenting their designs, object sizes, and benchmark results to guide developers in choosing the most efficient solution for large keyword sets.
Aho-CorasickJavaTrie
0 likes · 13 min read

This article examines various Java string‑replacement techniques—including simple replace, regex, Aho‑Corasick, and custom Trie implementations—by presenting their design, code samples, and detailed performance benchmarks to help developers choose the most efficient solution for large keyword sets.
Aho-CorasickAlgorithmJava performance
0 likes · 13 min read

This article explains how to use a Trie data structure in Go to efficiently store API paths with associated permissions, insert paths, perform fast permission validation, and demonstrates the approach with a complete, runnable code example and sample test cases.
APIBackendGo
0 likes · 9 min read

This article introduces the Trie (prefix tree) data structure, explains its basic architecture, demonstrates insertion, search, and deletion operations with complete Go implementations, and provides practical unit tests and real‑world applications such as autocomplete, spell checking, and IP routing.
GoPrefix TreeTrie
0 likes · 10 min read

This article explains the concept of a prefix tree (Trie), demonstrates how to build and use it for prefix searches, insertions, and deletions, and provides a complete Java implementation with detailed examples and visual illustrations.
JavaPrefix TreeTrie
0 likes · 9 min read


JavaEdgeDec 1, 2023 · Backend Development
This article explains how to build a real‑time typeahead (autocomplete) service that returns the most frequent query suggestions using an in‑memory Trie, sharding, offline aggregation, and caching to achieve sub‑20 ms latency, fault tolerance, and horizontal scalability.
Trieautocompletedistributed system
0 likes · 13 min read

By replacing the naïve double‑loop matcher with a Double‑Array Trie‑based Aho‑Corasick automaton and refactoring the system into a layered name‑and‑data microservice architecture that shards the keyword dictionary and rebuilds the automaton only on version changes, the real‑time keyword‑matching service reduced latency from seconds to milliseconds even at thousands of QPS.
Aho-CorasickJavaTrie
0 likes · 17 min read

This article explains how to implement an efficient routing system for Node.js web frameworks using a Trie (prefix tree) data structure, covering static, dynamic, and regex route matching, code examples, performance considerations, and practical tips for optimizing route lookup.
Node.jsPrefix TreeRouting
0 likes · 13 min read

This article demonstrates how to implement a sensitive‑word detection system in Go using a prefix‑tree (Trie), covering brute‑force, regex, and optimized rune‑based methods, plus special‑character filtering, pinyin support, and complete source code examples.
GoText FilteringTrie
0 likes · 19 min read

After struggling with a seemingly easy scoring problem in a regional programming contest, the author details multiple Go implementations—including a map, a 27‑base array, and a trie—examines their time and memory issues, discovers input handling pitfalls, and ultimately achieves an accepted solution.
AlgorithmTriecompetitive programming
0 likes · 14 min read

This article introduces common graph concepts and several advanced string‑matching algorithms—including Brute‑Force, Rabin‑Karp, KMP, Boyer‑Moore, AC automaton, Trie, and Double‑Array Trie—explaining their principles, implementations, complexity analyses, and typical application scenarios for search systems.
AlgorithmsKMPTrie
0 likes · 20 min read

This article explains the design and evolution of Baidu's word‑list service for content moderation, covering its background, multi‑layer architecture, management platform, strategy loading, matching workflow, performance optimizations for large texts, and future enhancements such as special‑character support and per‑business‑line deployment.
BOSContent moderationElasticsearch
0 likes · 16 min read

This article explains how to use a trie (prefix tree) to efficiently filter sensitive words in a text, covering the basic concepts, construction steps, traversal algorithm, complexity analysis, and a Java implementation using HashMap.
JavaSensitive Word FilteringTrie
0 likes · 9 min read

This article presents SlimTrie, a trie‑based indexing structure that dramatically reduces memory consumption while maintaining fast query speeds, detailing its design, compression techniques, implementation steps, memory analysis, and performance comparisons with map and B‑Tree structures for large‑scale storage systems.
GoIndexingSlimTrie
0 likes · 20 min read

This article examines the performance problems of a custom microservice gateway—including high CPU usage and frequent Full GCs—detailing root‑cause analysis, trie‑based URL routing, regex optimization, and further architectural improvements to enhance scalability and reliability.
Full GCJavaSpring
0 likes · 11 min read

FlashText is an open‑source Python library that dramatically speeds up keyword search and replacement in large text corpora, turning multi‑day regex operations into a fifteen‑minute task by leveraging the Aho‑Corasick algorithm and a Trie‑based dictionary.
Aho-CorasickFlashTextPython
0 likes · 8 min read


21CTOAug 5, 2017 · Backend Development
This article walks through solving a massive log‑keyword counting task—600,000 short messages and 50,000 keywords—by evolving from a simple grep‑based approach to regex optimizations, word‑splitting, a trie data structure, and finally a multi‑process Redis queue, achieving a performance boost from hours to under ten minutes.
Triegreplog processing
0 likes · 15 min read

The discussion outlines practical anti‑spam strategies—including text length limits, keyword replacement, trie‑based data structures, AC automata, Bayesian and vector‑similarity algorithms, and PHP extensions such as libdatrie—while also sharing performance metrics and resource links for implementing robust content filtering systems.
PHPTriecontent filtering
0 likes · 4 min read

This article demystifies the common belief that cache‑plus‑hash alone solves high‑concurrency challenges, explores essential techniques such as static resource serving, read‑write separation, advanced caching, hash‑based sharding, and especially the design trade‑offs of various Trie‑based data structures for search‑suggestion services, and offers practical optimization steps.
Triebackend architecturehashing
0 likes · 28 min read
