I'm trying to implement a datastructure such that it'll give autocompleted words when the user writes something. So far I've implemented a trie properly, and the autocomplete works quite fast. Thing is, when loading all the information needed, it uses a bonkers amount of memory. I've generally seen that many people say that tries are faster but less space efficient, and vice versa for a ternary tree. I've got an alphabet of about 55-60 characters and am expecting about 800k - 1.2 million words inserted into the tree. Is this just generally a way too large amount of insertions into the trie to work well, space wise? Would switching it to a ternary tree be smarter, memory wise? And would it, if switched to a ternary tree, be "annoyingly" slow to search in?
Thanks!