Ejemplo n.º 1
0
        public static TernaryTree <V> Create(IDictionary <string, V> keyValueSet)
        {
            TernaryTree <V> tree = new TernaryTree <V>();

            foreach (KeyValuePair <string, V> keyValuePair in keyValueSet)
            {
                tree.Add(keyValuePair.Key, keyValuePair.Value);
            }
            return(tree);
        }
Ejemplo n.º 2
0
        public static TernaryTree <V> Create(ICollection <string> keySet)
        {
            TernaryTree <V> tree = new TernaryTree <V>();

            foreach (string key in keySet)
            {
                tree.Add(key);
            }
            return(tree);
        }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="head"></param>
 /// <returns></returns>
 public ICollection <string> Match(TernaryTree <V> tree)
 {
     _ = tree ?? throw new ArgumentNullException(nameof(tree));
     _getBranchMatches(tree.Head, default(string));
     return(_matches);
 }
 public TernaryTreeEnumerator(TernaryTree <V> tree)
 {
     _tree = tree ?? throw new ArgumentNullException(nameof(tree));
     _head = _tree.Head;
 }