protected virtual IEnumerable <TValue> SearchDeep(string query, int position) { TrieNodeBase <TValue> nextNode = this.GetChildOrNull(query, position); return(nextNode != null ? nextNode.Retrieve(query, position + nextNode.KeyLength) : Enumerable.Empty <TValue>()); }
public void Add(string key, int position, TValue value) { if (key == null) { throw new ArgumentNullException("key"); } if (EndOfString(position, key)) { this.AddValue(value); return; } TrieNodeBase <TValue> child = this.GetOrCreateChild(key[position]); child.Add(key, position + 1, value); }