This introduction is here in case you'd like to treat this as a programming excercise yourself.
A trie (spoilers) is a fairly simple but powerful structure in computer science.
My goal here was simply to mimic a HashSet<string>
with much better in-memory storage results (assuming that HashSet<string>
, being generic must keep an instance of each string). NOT storing any data other than if the string exists or not.
It can allow you to store an extremely large number of strings with very small storage space and lookup operations are O(length-of-word), with no relation to how many items are being checked against.