Click or drag to resize
DigitalRuneTreeHelperGetHeightT Method
Gets the height of the specified tree or subtree.

Namespace: DigitalRune.Linq
Assembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax
public static int GetHeight<T>(
	T tree,
	Func<T, IEnumerable<T>> getChildren
)
where T : class

Parameters

tree
Type: T
The root of a tree or subtree.
getChildren
Type: SystemFuncT, IEnumerableT

A method that retrieves the children of an object of type T.

GetHeightT(T, FuncT, IEnumerableT) guarantees that getChildren is never called with as parameter. The enumeration returned by getChildren may contain .

Type Parameters

T
The type of tree node.

Return Value

Type: Int32
The height of the tree or subtree.
Exceptions
ExceptionCondition
ArgumentNullExceptiontree is .
Remarks
The height of the tree is the length of the longest downward path to a leaf. A leaf node has a height of 0.
See Also