Implements: IBinarySearchTree<T>
Represents a node-based, self-balancing IBinarySearchTree enhanced to implement an efficient indexer.
RedBlackTree()
Initializes a new instance of RedBlackTree that is empty.
RedBlackTree(IEnumerable<T> collection)
Initializes a new instance of RedBlackTree that contains every item from the input collection.
RedBlackTree(IComparer<T> comparer)
Initializes a new instance of RedBlackTree that is empty and uses the specified IComparer.
int Count
Gets the number of elements stored in the RedBlackTree. Complexity: O(1)
T Min
Gets the minimum value element stored in the RedBlackTree. Complexity: O(LogN)
T Max
Gets the maximum value element stored in the RedBlackTree. Complexity: O(LogN)
T this[int index]
Gets the element at the specified index. Complexity: O(LogN)
int Insert(T value)
Inserts an element into the RedBlackTree and returns its index. Complexity: O(LogN)
bool Find(T value)
Determines whether the RedBlackTree contains a specific value. Complexity: O(LogN)
bool Remove(T value)
Removes one occurrence of a specific element from the RedBlackTree. Complexity: O(LogN)
T[] InOrderTraverse()
Returns the list of the elements stored in the RedBlackTree in-order. Complexity: O(N)
T[] PreOrderTraverse()
Returns the list of the elements stored in the RedBlackTree pre-order. Complexity: O(N)
T[] PostOrderTraverse()
Returns the list of the elements stored in the RedBlackTree post-order. Complexity: O(N)