Trie minimization algorithm implemented.