def insert(self, word):
        """
        Inserts a word into the trie.
        :type word: str
        :rtype: void
        """
        node = self.root
        for i in range(len(word)):
            ch = word[i]
            if node.containsKey(ch) is False:
                node.put(ch, TrieNode())
            node = node.get(ch)
        node.setEnd()

        Inserts a word into the trie.
        :type word: str
        :rtype: void
        
python/208_Implement_Trie_(Prefix_Tree).py