Class BinarySearchTree<TValue, TTree, TTreeNode>
- Namespace
- Garyon.DataStructures.Trees
- Assembly
- Garyon.dll
Represents a tree.
public abstract class BinarySearchTree<TValue, TTree, TTreeNode> : BinaryTree<TValue, TTree, TTreeNode>, ITree<TValue, TTree, TTreeNode>, ITree<TValue>, ICollection<TValue>, IEnumerable<TValue>, IEnumerable where TValue : IComparable<TValue> where TTree : BinarySearchTree<TValue, TTree, TTreeNode> where TTreeNode : BinarySearchTreeNode<TValue, TTree, TTreeNode>
Type Parameters
TValueThe type of the elements the tree nodes store.
TTreeThe type of the tree that this type is used in.
TTreeNodeThe type of the tree nodes that are used in the
TTreetype.
- Inheritance
-
BaseTree<TValue, TTree, TTreeNode>BinaryTree<TValue, TTree, TTreeNode>BinarySearchTree<TValue, TTree, TTreeNode>
- Implements
-
ITree<TValue, TTree, TTreeNode>ITree<TValue>ICollection<TValue>IEnumerable<TValue>
- Derived
- Inherited Members
- Extension Methods
Constructors
BinarySearchTree()
Initializes a new instance of the BinarySearchTree<TValue, TTree, TTreeNode> class with no root node.
protected BinarySearchTree()
BinarySearchTree(TValue)
Initializes a new instance of the BinarySearchTree<TValue, TTree, TTreeNode> class with a root value.
protected BinarySearchTree(TValue rootValue)
Parameters
rootValueTValueThe value of the root node.
BinarySearchTree(TTree)
Initializes a new instance of the BinarySearchTree<TValue, TTree, TTreeNode> class from a different tree.
protected BinarySearchTree(TTree tree)
Parameters
treeTTreeThe tree to create this tree from. Both trees remain independent.
BinarySearchTree(TTreeNode)
Initializes a new instance of the BinarySearchTree<TValue, TTree, TTreeNode> class with a root node.
protected BinarySearchTree(TTreeNode root)
Parameters
rootTTreeNodeThe root node.
Methods
Find(TValue)
Attempts to find a node with the specified value within this tree.
public TTreeNode Find(TValue value)
Parameters
valueTValueThe value of the node to be found.
Returns
- TTreeNode
The node within this tree that has the specified value, if found, otherwise null.