Beispiel #1
0
        public void Main()
        {
            var words = new[] { "pre", "prefix" };
            var trie  = new Trie(words);

            // Print "pre" and "prefix"
            foreach (var word in trie.GetTokens("pr"))
            {
                Console.WriteLine(word);
            }
        }
Beispiel #2
0
 public IEnumerable <string> GetTokens(string prefix)
 {
     return(_trie.GetTokens(prefix));
 }