Collections Collections
Collections Collections
DocFX + Singulink = ♥

Search Results for

    Method BinarySearch

    BinarySearch(int, int, T, IComparer<T>?)

    Searches a range of items in the sorted list and returns the index of the item.

    Declaration
    public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
    Parameters
    Type Name Description
    int index
    int count
    T item
    IComparer<T> comparer
    Returns
    Type Description
    int

    The index of item in the sorted list, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next item that is larger than item or, if there is no larger item, the bitwise complement of Count.

    BinarySearch(T)

    Searches the items in the sorted list and returns the index of the item.

    Declaration
    public int BinarySearch(T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    int

    The index of item in the sorted list, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next item that is larger than item or, if there is no larger item, the bitwise complement of Count.

    BinarySearch(T, IComparer<T>?)

    Searches the items in the sorted list and returns the index of the item.

    Declaration
    public int BinarySearch(T item, IComparer<T>? comparer)
    Parameters
    Type Name Description
    T item
    IComparer<T> comparer
    Returns
    Type Description
    int

    The index of item in the sorted list, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next item that is larger than item or, if there is no larger item, the bitwise complement of Count.

    © Singulink. All rights reserved.