• Performs a sequential search on a linked list.

    This function traverses the linked list one node at a time, applying the provided predicate to each node. It returns the first node for which the predicate returns true. If no node matches, it returns null.

    Type Parameters

    • T

      The type of data stored in the nodes.

    Parameters

    • list: default<T>

      The linked list to search through.

    • predicate: Predicate<T>

      A function that determines whether a node satisfies the search condition.

    Returns null | default<T>

    The first node matching the predicate, or null if no match is found.