Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 3
0
 static void Main(string[] args)
 {
     PrefixTrie.driver();
     Console.ReadLine();
 }