Пример #1
0
 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"));
 }
Пример #2
0
        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"));
        }
Пример #3
0
 static void Main(string[] args)
 {
     PrefixTrie.driver();
     Console.ReadLine();
 }