Trie data structure and related API