Tries: Autocomplete, Prefix Search and Memory Cost in C#
A trie stores keys character by character and finds a prefix in O(m) steps, but its memory cost is high: for 234,456 words a sorted array takes 11.7 MB, a trie 148.9 MB. We write a trie with top-N suggestions in C#, solve the Turkish İ/ı case folding trap, build a minimal API and an Angular search box, and compare a sorted array, PostgreSQL LIKE and the trie with measurements.
8 Nov 2026
·
14 min
·
2