Generated by DocFX

Class TreeTraversal

Static class with tree traversal methods.

Inheritance
System.Object
TreeTraversal
Namespace: ISynergy.Framework.Core.Collections
Assembly: ISynergy.Framework.Core.dll
Syntax
public static class TreeTraversal : object

Methods

View Source

BreadthFirst<TNode>(BinaryTree<TNode>)

Breadth-first tree traversal method.

Declaration
public static IEnumerator<TNode> BreadthFirst<TNode>(BinaryTree<TNode> tree)
    where TNode : BinaryNode<TNode>, new()
Parameters
Type Name Description
BinaryTree<TNode> tree

The tree.

Returns
Type Description
IEnumerator<TNode>

IEnumerator<TNode>.

Type Parameters
Name Description
TNode

The type of the t node.

View Source

DepthFirst<TNode>(BinaryTree<TNode>)

Depth-first tree traversal method.

Declaration
public static IEnumerator<TNode> DepthFirst<TNode>(BinaryTree<TNode> tree)
    where TNode : BinaryNode<TNode>
Parameters
Type Name Description
BinaryTree<TNode> tree

The tree.

Returns
Type Description
IEnumerator<TNode>

IEnumerator<TNode>.

Type Parameters
Name Description
TNode

The type of the t node.

View Source

InOrder<TNode>(BinaryTree<TNode>)

In-order tree traversal method.

Declaration
public static IEnumerator<TNode> InOrder<TNode>(BinaryTree<TNode> tree)
    where TNode : BinaryNode<TNode>, new()
Parameters
Type Name Description
BinaryTree<TNode> tree

The tree.

Returns
Type Description
IEnumerator<TNode>

IEnumerator<TNode>.

Type Parameters
Name Description
TNode

The type of the t node.

View Source

PostOrder<TNode>(BinaryTree<TNode>)

Post-order tree traversal method.

Declaration
public static IEnumerator<TNode> PostOrder<TNode>(BinaryTree<TNode> tree)
    where TNode : BinaryNode<TNode>, new()
Parameters
Type Name Description
BinaryTree<TNode> tree

The tree.

Returns
Type Description
IEnumerator<TNode>

IEnumerator<TNode>.

Type Parameters
Name Description
TNode

The type of the t node.

View Source

PreOrder<TNode>(BinaryTree<TNode>)

Pre-order tree traversal method.

Declaration
public static IEnumerator<TNode> PreOrder<TNode>(BinaryTree<TNode> tree)
    where TNode : BinaryNode<TNode>, new()
Parameters
Type Name Description
BinaryTree<TNode> tree

The tree.

Returns
Type Description
IEnumerator<TNode>

IEnumerator<TNode>.

Type Parameters
Name Description
TNode

The type of the t node.