示例#1
0
        public static void driver()
        {
            string[] words = {"to", "tea", "ten", "ted", "toll", "trail", "tall", "inn", "tele", "telemat", "teleport", "tell" };
            PrefixTrie tree = new PrefixTrie();
            foreach (string s in words)
                tree.insert(s);

            List<string> lstWords = tree.Predictions("tel");
            foreach(string word in lstWords)
            {
                Console.WriteLine(word);
            }
        }
示例#2
0
        public static void driver()
        {
            string[]   words = { "to", "tea", "ten", "ted", "toll", "trail", "tall", "inn", "tele", "telemat", "teleport", "tell" };
            PrefixTrie tree  = new PrefixTrie();

            foreach (string s in words)
            {
                tree.insert(s);
            }

            List <string> lstWords = tree.Predictions("tel");

            foreach (string word in lstWords)
            {
                Console.WriteLine(word);
            }
        }
示例#3
0
 static void Main(string[] args)
 {
     PrefixTrie.driver();
     Console.ReadLine();
 }