The binary and ternary search trees would be slower than the hash or the trie. The ternary search tree would be O(log n) time complexity while the trie and hash have typical time complexities of O(1) with the hash degrading to a O(n) as collisions increase. That said, I'd go with the trie.