Question: typedef struct TrieNode { // number of times this string occurs in the corpus int count; // 26 TrieNode pointers, one for each letter of
typedef struct TrieNode { // number of times this string occurs in the corpus int count;
// 26 TrieNode pointers, one for each letter of the alphabet struct TrieNode *children[26];
// the co-occurrence subtrie for this string struct TrieNode *subtrie; } TrieNode;
IN C language
int prefixCount(TrieNode *root, char *str); Description: Counts the number of strings in the trie (with count 2 1) that begin with the specified string, str. Note that if the specified string itself is contained within the trie, that string should be included in the count. If one of these strings occurs more than once, its entire count should be added to the return value. Note: You might find that you don't need this function to build out the text prediction functionality of your code, but you still need to implement it as part of this assignment Returns: The number of strings in the trie that begin with the specified string, str
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
