예제 #1
0
 public TrieItem <T> Find(Bits bits)
 {
     if (bits.Count <= Prefix.Count)
     {
         return(bits.Equals(Prefix) ? this : null);
     }
     if (bits.Skip(Prefix.Count).First())
     {
         return(True?.Find(bits.Skip(Prefix.Count + 1)));
     }
     else
     {
         return(False?.Find(bits.Skip(Prefix.Count + 1)));
     }
 }
예제 #2
0
 private TrieItem <TValue> FindNodeForKey(string key)
 {
     return(_root.Find(GetBits(key)));
 }