Added custom heap and trie implementations