Table of Contents

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

TValue

The type of the elements the tree nodes store.

TTree

The type of the tree that this type is used in.

TTreeNode

The type of the tree nodes that are used in the TTree type.

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

rootValue TValue

The 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

tree TTree

The 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

root TTreeNode

The root node.

Methods

Find(TValue)

Attempts to find a node with the specified value within this tree.

public TTreeNode Find(TValue value)

Parameters

value TValue

The value of the node to be found.

Returns

TTreeNode

The node within this tree that has the specified value, if found, otherwise null.