Question: Need help with the following C code: The structure of a trieNode is as follows: struct trieNode( struct trieNode* letters[26]; int EOS; I; Your goal
Need help with the following C code:

The structure of a trieNode is as follows: struct trieNode( struct trieNode* letters[26]; int EOS; I; Your goal is to write a function: void addWord (struct trieNode* root, char *word); which accepts a single trieNode pointer, and a string named "word" (which is guaranteed to consist of only uppercase letters between A and Z, inclusive). Your function should add the word to the trie. You may assume the word is not already present in the trie. To do this, begin with the first letter of the word, check that pointer in the root node, and if it is non-NULL, follow it to another node; otherwise, create a new (properly-initialized) trieNode, point to it, and continue. After following the pointer for the last letter, set EOS-1 in that node
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
