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); }
public static TernaryTree <V> Create(ICollection <string> keySet) { TernaryTree <V> tree = new TernaryTree <V>(); foreach (string key in keySet) { tree.Add(key); } return(tree); }
/// <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; }