RedBlackTree
November 14, 2020 ยท View on GitHub
Implements: IBinarySearchTree<T>
Represents a node-based, self-balancing IBinarySearchTree
Constructors
RedBlackTree() Initializes a new instance of RedBlackTree
RedBlackTree(IEnumerable<T> collection) Initializes a new instance of RedBlackTree
RedBlackTree(IComparer<T> comparer) Initializes a new instance of RedBlackTree
Properties
int Count Gets the number of elements stored in the RedBlackTree
T Min Gets the minimum value element stored in the RedBlackTree
T Max Gets the maximum value element stored in the RedBlackTree
T this[int index] Gets the element at the specified index. Complexity: O(LogN)
Methods
int Insert(T value) Inserts an element into the RedBlackTree
bool Find(T value) Determines whether the RedBlackTree
bool Remove(T value) Removes one occurrence of a specific element from the RedBlackTree
T[] InOrderTraverse() Returns the list of the elements stored in the RedBlackTree
T[] PreOrderTraverse() Returns the list of the elements stored in the RedBlackTree
T[] PostOrderTraverse() Returns the list of the elements stored in the RedBlackTree