public static void driver() { string[] words = {"this", "is", "was", "tea", "today", "total" }; PrefixTrie trie = new PrefixTrie(); foreach (string s in words) trie.AddWord(s); Console.WriteLine("IsPrefix = {0}", trie.IsPrefix("tot")); }
public static void driver() { string[] words = { "this", "is", "was", "tea", "today", "total" }; PrefixTrie trie = new PrefixTrie(); foreach (string s in words) { trie.AddWord(s); } Console.WriteLine("IsPrefix = {0}", trie.IsPrefix("tot")); }
static void Main(string[] args) { PrefixTrie.driver(); Console.ReadLine(); }