Table of Contents

Class BinaryTree<T>

Namespace
Garyon.DataStructures.Trees
Assembly
Garyon.dll

Represents a binary tree.

public class BinaryTree<T> : BinaryTree<T, BinaryTree<T>, BinaryTreeNode<T>>, ITree<T, BinaryTree<T>, BinaryTreeNode<T>>, ITree<T>, ICollection<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

The type of the elements the binary tree nodes store.

Inheritance
BinaryTree<T>
Implements
Inherited Members
Extension Methods

Constructors

BinaryTree()

Initializes a new instance of the BinaryTree<T> class with no root node.

public BinaryTree()

BinaryTree(BinaryTreeNode<T>)

Initializes a new instance of the BinaryTree<T> class with a root node.

public BinaryTree(BinaryTreeNode<T> root)

Parameters

root BinaryTreeNode<T>

The root node.

BinaryTree(BinaryTree<T>)

Initializes a new instance of the BinaryTree<T> class from a different tree.

public BinaryTree(BinaryTree<T> tree)

Parameters

tree BinaryTree<T>

The tree to create this tree from. Both trees remain independent.

BinaryTree(T)

Initializes a new instance of the BinaryTree<T> class with a root value.

public BinaryTree(T rootValue)

Parameters

rootValue T

The value of the root node.

Methods

InitializeNewNode(BinaryTreeNode<T>, T)

Initializes a new instance of the TreeNode<T> class with a parent node. The base tree is considered to be that of the parent.

protected override BinaryTreeNode<T> InitializeNewNode(BinaryTreeNode<T> parentNode, T value = default)

Parameters

parentNode BinaryTreeNode<T>

The parent node.

value T

The value of the node.

Returns

BinaryTreeNode<T>

InitializeNewNode(BinaryTree<T>, T)

Initializes a new instance of the TreeNode<T> class with a base tree, but no parent node.

protected override BinaryTreeNode<T> InitializeNewNode(BinaryTree<T> baseTree, T value = default)

Parameters

baseTree BinaryTree<T>

The base tree that contains this node.

value T

The value of the node.

Returns

BinaryTreeNode<T>

InitializeNewNode(T)

Initializes a new instance of the TreeNode<T> class with no base tree or parent node.

protected override BinaryTreeNode<T> InitializeNewNode(T value = default)

Parameters

value T

The value of the node.

Returns

BinaryTreeNode<T>