예제 #1
0
 public IEnumerable <AVLNode> Range(TKey lower, TKey upper)
 {
     foreach (var item in AVLNode.EnumerateFrom(_root, lower, _comparison))
     {
         var comparison = _comparison;
         if (comparison(item.Key, upper) > 0)
         {
             break;
         }
         yield return(item);
     }
 }
예제 #2
0
        public IEnumerable <AVLNode <TKey, TValue> > Range(TKey lower, TKey upper)
        {
            foreach (var item in AVLNode <TKey, TValue> .EnumerateFrom(_root, lower, _comparer))
            {
                var comparer = _comparer;
                if (comparer.Compare(item.Key, upper) > 0)
                {
                    break;
                }

                yield return(item);
            }
        }