private static void FindWordsInText(Trie trie, string[] randomSearchWords) { for (int i = 0; i < randomSearchWords.Length; i++) { Console.WriteLine("Word {0} appears {1}", randomSearchWords[i], trie.GetCount(randomSearchWords[i])); } }
private static Trie GenerateTrie(string[] words, int count) { var trie = new Trie(); for (int i = 0; i < count; i++) { trie.AddWord(words[random.GenerateRandomNumber(0, words.Length - 1)]); } return trie; }