예제 #1
0
 /// <summary>
 /// Retrieves the minimum key and the associated value.
 /// </summary>
 /// <returns>The tuple of the minimum key, associated value and the
 /// dictionary containing all other elements, if the dictionary is
 /// non-empty; <c>None</c> otherwise.</returns>
 public Optional <Tuple <TKey, TValue> > MinKeyAndValue()
 {
     if (Count == 0)
     {
         return(Optional <Tuple <TKey, TValue> > .None);
     }
     if (Count == 1)
     {
         return(Optional.Some(Tuple.New(_key, _value)));
     }
     return(_left.MinKeyAndValue());
 }