A red�black tree is a type of self-balancing binary search tree, a data structure used in computer science, typically to implement associative arrays.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Type Parameters:
TKey
The type of the key.
TValue
The type of the value.
Syntax:
public class RedBlackTree<TKey, TValue> : RedBlackTree<KeyValuePair<TKey, TValue>>, ISearchTree<KeyValuePair<TKey, TValue>>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Inheritance: objectBinarySearchTreeBase<KeyValuePair<TKey, TValue>>RedBlackTree<KeyValuePair<TKey, TValue>>RedBlackTree<TKey, TValue>
Implements:
Inherited Members
Constructors
Initializes a new instance of the RedBlackTree<TKey, TValue> class.
public RedBlackTree()
Initializes a new instance of the RedBlackTree<TKey, TValue> class.
public RedBlackTree(Comparison<TKey> comparison)
The comparison.
Initializes a new instance of the RedBlackTree<TKey, TValue> class.
Properties
Keys
ICollection<TKey>
Gets an ICollection<T> containing the keys of the IDictionary<TKey, TValue>.
public ICollection<TKey> Keys { get; }
Implements:
this[TKey]
TValue
Gets or sets the value with the specified key.
public TValue this[TKey key] { get; set; }
The key of the item to set or get.
Implements:
Values
ICollection<TValue>
Gets an ICollection<T> containing the values in the IDictionary<TKey, TValue>.
public ICollection<TValue> Values { get; }
Implements:
Methods
Adds an element with the provided key and value to the IDictionary<TKey, TValue>.
public void Add(TKey key, TValue value)
The object to use as the key of the element to add.
valueTValueThe object to use as the value of the element to add.
Implements:
Determines whether this tree contains the given item.
public override bool Contains(KeyValuePair<TKey, TValue> item)
The item.
Returns:true if the item is in this tree; otherwise, false.
Overrides:
Implements:
Determines whether the IDictionary<TKey, TValue> contains an element with the specified key.
public bool ContainsKey(TKey key)
The key to locate in the IDictionary<TKey, TValue>.
Returns:True if the IDictionary<TKey, TValue> contains an element with the key; otherwise, false.
Exceptions:key is null.
Implements:
Removes the element with the specified key from the IDictionary<TKey, TValue>.
public bool Remove(TKey key)
The key of the element to remove.
Returns:True if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary<TKey, TValue>.
key is null.
The IDictionary<TKey, TValue> is read-only.
Implements:
Attempts to the get value.
public bool TryGetValue(TKey key, out TValue value)
The key.
valueTValueThe value.
Returns:Implements: