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