Table of Contents

Class TreeNode<T>

Namespace
Garyon.DataStructures.Trees
Assembly
Garyon.dll

Represents a tree node, which is a component that is contained within a tree.

public class TreeNode<T> : TreeNode<T, Tree<T>, TreeNode<T>>, ITreeNode<T, Tree<T>, TreeNode<T>>, ITreeNode<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

The type of the value that is stored in the node.

Inheritance
TreeNode<T>
Implements
Inherited Members
Extension Methods

Constructors

TreeNode(TreeNode<T>, List<TreeNode<T>>, T)

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

public TreeNode(TreeNode<T> parentNode, List<TreeNode<T>> childrenNodes, T value = default)

Parameters

parentNode TreeNode<T>

The parent node.

childrenNodes List<TreeNode<T>>

The children nodes.

value T

The value of the node.

TreeNode(TreeNode<T>, T)

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

public TreeNode(TreeNode<T> parentNode, T value = default)

Parameters

parentNode TreeNode<T>

The parent node.

value T

The value of the node.

TreeNode(Tree<T>, T)

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

public TreeNode(Tree<T> baseTree, T value = default)

Parameters

baseTree Tree<T>

The base tree that contains this node.

value T

The value of the node.

TreeNode(T)

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

public TreeNode(T value = default)

Parameters

value T

The value of the node.

Methods

InitializeNewNode(TreeNode<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 TreeNode<T> InitializeNewNode(TreeNode<T> parentNode, T value = default)

Parameters

parentNode TreeNode<T>

The parent node.

value T

The value of the node.

Returns

TreeNode<T>

InitializeNewNode(Tree<T>, T)

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

protected override TreeNode<T> InitializeNewNode(Tree<T> baseTree, T value = default)

Parameters

baseTree Tree<T>

The base tree that contains this node.

value T

The value of the node.

Returns

TreeNode<T>

InitializeNewNode(T)

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

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

Parameters

value T

The value of the node.

Returns

TreeNode<T>