New to Telerik UI for WPFStart a free 30-day trial

Red-Black tree data structure.

Definition

Constructors

Initializes a new instance of the RedBlackTree<T> class.

C#
public RedBlackTree()
Remarks:

The default comparer for the data type will be used.

Initializes a new instance of the RedBlackTree<T> class.

C#
public RedBlackTree(Comparison<T> comparison)
Parameters:comparisonComparison<T>

The comparison.

Initializes a new instance of the RedBlackTree<T> class.

C#
public RedBlackTree(IComparer<T> comparer)
Parameters:comparerIComparer<T>

The comparer.

Methods

Adds an element with the provided key and value to the IDictionary<TKey, TValue>.

C#
protected override void AddItem(T item)
Parameters:itemT

The item.

Overrides: BinarySearchTreeBase<T>.AddItem(T)

Removes the element with the specified key from the IDictionary<TKey, TValue>.

C#
protected override bool RemoveItem(T item)
Parameters:itemT

The item to remove.

Returns:

bool

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>.

Overrides: BinarySearchTreeBase<T>.RemoveItem(T)