Class TreeSearchAlgorithm<TInternalNode, TLeafNode>
A base class for algorithms that search trees.
Inheritance
System.Object
TreeSearchAlgorithm<TInternalNode, TLeafNode>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Flame.Collections
Assembly: Flame.dll
Syntax
public abstract class TreeSearchAlgorithm<TInternalNode, TLeafNode>
Type Parameters
Name | Description |
---|---|
TInternalNode | The type of an internal tree node. |
TLeafNode | The type of a leaf node. |
Constructors
| Improve this Doc View SourceTreeSearchAlgorithm(Func<TInternalNode, Tuple<IEnumerable<TInternalNode>, IEnumerable<TLeafNode>>>)
Creates a tree search algorithm.
Declaration
public TreeSearchAlgorithm(Func<TInternalNode, Tuple<IEnumerable<TInternalNode>, IEnumerable<TLeafNode>>> getChildren)
Parameters
Type | Name | Description |
---|---|---|
System.Func<TInternalNode, System.Tuple<System.Collections.Generic.IEnumerable<TInternalNode>, System.Collections.Generic.IEnumerable<TLeafNode>>> | getChildren | A function that takes an internal node and produces its children. |
Properties
| Improve this Doc View SourceGetChildren
Gets the children of an internal node as an (internal nodes, leaf nodes) pair.
Declaration
public Func<TInternalNode, Tuple<IEnumerable<TInternalNode>, IEnumerable<TLeafNode>>> GetChildren { get; }
Property Value
Type | Description |
---|---|
System.Func<TInternalNode, System.Tuple<System.Collections.Generic.IEnumerable<TInternalNode>, System.Collections.Generic.IEnumerable<TLeafNode>>> |
Methods
| Improve this Doc View SourceSearch(TInternalNode)
Searches through a tree rooted at a particular node.
Declaration
public abstract TLeafNode Search(TInternalNode root)
Parameters
Type | Name | Description |
---|---|---|
TInternalNode | root | The root of the tree to search through. |
Returns
Type | Description |
---|---|
TLeafNode | A leaf node. |