Show / Hide Table of Contents

    Class Traversal<T>

    Base class for traversal algorithms.

    Inheritance
    System.Object
    Traversal<T>
    BreadthFirstTraversal<T>
    DepthFirstTraversal<T>
    PostOrderTraversal<T>
    TopologicalTraversal<T>
    Implements
    ITraversal<T>
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Virtlink.Utilib.Collections.Graphs
    Assembly: Virtlink.Utilib.dll
    Syntax
    public abstract class Traversal<T> : ITraversal<T>
    Type Parameters
    Name Description
    T

    Methods

    | Improve this Doc View Source

    GetChildren(T)

    Returns the children of the specified node.

    Declaration
    protected abstract IEnumerable<T> GetChildren(T node)
    Parameters
    Type Name Description
    T node

    The node.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>
    | Improve this Doc View Source

    IsReturned(T, T)

    Returns whether to return the specified node.

    Declaration
    protected virtual bool IsReturned(T node, T root)
    Parameters
    Type Name Description
    T node

    The node.

    T root

    The root node at which the traversal started.

    Returns
    Type Description
    System.Boolean

    true to return the specified node; otherwise, false.

    | Improve this Doc View Source

    IsTraversed(T, T)

    Returns whether to traverse the children of the specified node.

    Declaration
    protected virtual bool IsTraversed(T node, T root)
    Parameters
    Type Name Description
    T node

    The node.

    T root

    The root node at which the traversal started.

    Returns
    Type Description
    System.Boolean

    true to traverse the children of the node; otherwise, false.

    | Improve this Doc View Source

    Traverse(T)

    Declaration
    public abstract IEnumerable<T> Traverse(T root)
    Parameters
    Type Name Description
    T root
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    Implements

    ITraversal<T>
    • Improve this Doc
    • View Source
    Back to top Copyright - Daniel Pelsmaeker