|
|
|
|
|
|
(!ReferenceEquals(item.Value, null) && item.Value.Equals(this.root.Value))); |
|
|
|
} |
|
|
|
|
|
|
|
public KeyValuePair<TKey, TValue> First() { |
|
|
|
public KeyValuePair<TKey, TValue>? First() { |
|
|
|
throw new NullReferenceException("The root of this tree is null!"); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
while (t.LeftChild != null) { |
|
|
|
|
|
|
return new KeyValuePair<TKey, TValue>(t.Key, t.Value); |
|
|
|
} |
|
|
|
|
|
|
|
public KeyValuePair<TKey, TValue> Last() { |
|
|
|
public KeyValuePair<TKey, TValue>? Last() { |
|
|
|
throw new NullReferenceException("The root of this tree is null!"); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
while (t.RightChild != null) { |
|
|
|