int Trie::insert(char word[]) { int len = strlen(word); TNode* current = root; int i = 0; char c; // processing each character while (i < len) { c = word[i++]; if (current->exist_child(c) == NULL) num_nodes++; current = current->get_child_node(tolower(c)); } if (!current->end_of_word()) { num_words++; current->set_end_of_word(true); } }