Class RedBlackTree<TData>

Represents a generic red-black tree

Inheritance
System.Object
RedBlackTree<TData>
Implements
System.Collections.Generic.IEnumerable<RedBlackTreeNode<TData>>
System.Collections.IEnumerable
Namespace: Solti.Utils.Primitives
Assembly: Solti.Utils.Primitives.dll
Syntax
public class RedBlackTree<TData> : Object
Type Parameters
Name Description
TData

Constructors

RedBlackTree(IComparer<TData>)

Creates a new RedBlackTree<TData> instance.

Declaration
public RedBlackTree(IComparer<TData> comparer)
Parameters
Type Name Description
System.Collections.Generic.IComparer<TData> comparer

Properties

Comparer

The related comparer..

Declaration
public IComparer<TData> Comparer { get; }
Property Value
Type Description
System.Collections.Generic.IComparer<TData>

Count

The number of leaves.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

Root

The root of this tree.

Declaration
public RedBlackTreeNode<TData> Root { get; }
Property Value
Type Description
RedBlackTreeNode<TData>

Methods

Add(TData)

Adds a new data to this tree.

Declaration
public bool Add(TData data)
Parameters
Type Name Description
TData data
Returns
Type Description
System.Boolean

Add(RedBlackTreeNode<TData>)

Adds a new node to this tree.

Declaration
public bool Add(RedBlackTreeNode<TData> node)
Parameters
Type Name Description
RedBlackTreeNode<TData> node
Returns
Type Description
System.Boolean

GetEnumerator()

Returns an enumerator that iterates through the nodes.

Declaration
public IEnumerator<RedBlackTreeNode<TData>> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<RedBlackTreeNode<TData>>

With(TData)

Creates a new tree containing the new data.

Declaration
public RedBlackTree<TData> With(TData data)
Parameters
Type Name Description
TData data
Returns
Type Description
RedBlackTree<TData>

With(RedBlackTreeNode<TData>)

Creates a new tree containing the new node.

Declaration
public RedBlackTree<TData> With(RedBlackTreeNode<TData> node)
Parameters
Type Name Description
RedBlackTreeNode<TData> node
Returns
Type Description
RedBlackTree<TData>

Implements

System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable

Extension Methods

RedBlackTreeExtensions.Clone<TData>(RedBlackTree<TData>)
In This Article
Back to top Generated by DocFX