Show / Hide Table of Contents

    Class BreadthFirstTraversal

    Breadth-first traversal.

    Inheritance
    System.Object
    BreadthFirstTraversal
    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 static class BreadthFirstTraversal

    Methods

    | Improve this Doc View Source

    Traverse<T>(T)

    Traverses a tree whose nodes implement the INode<T> interface.

    Declaration
    public static IEnumerable<T> Traverse<T>(T root)where T : INode<T>
    Parameters
    Type Name Description
    T root

    The root of the tree.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    An enumerable that returns the tree's nodes in depth-first pre-order.

    Type Parameters
    Name Description
    T

    The type of nodes.

    | Improve this Doc View Source

    Traverse<T>(T, Func<T, IReadOnlyCollection<T>>)

    Traverses a tree where the children of a node are returned by a lambda function.

    Declaration
    public static IEnumerable<T> Traverse<T>(T root, Func<T, IReadOnlyCollection<T>> childrenGetter)
    Parameters
    Type Name Description
    T root

    The root of the tree.

    System.Func<T, System.Collections.Generic.IReadOnlyCollection<T>> childrenGetter

    Function that returns the children of the node.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    An enumerable that returns the tree's nodes in depth-first pre-order.

    Type Parameters
    Name Description
    T

    The type of nodes.

    • Improve this Doc
    • View Source
    Back to top Copyright - Daniel Pelsmaeker