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