Trie and linear probing implementation