MemoryExtensions.BinarySearch Metoda

Definice

Přetížení

Name Description
BinarySearch<T,TComparable>(Span<T>, TComparable)

Vyhledá celou seřazenou Span<T> hodnotu pomocí zadaného TComparable obecného typu.

BinarySearch<T,TComparable>(ReadOnlySpan<T>, TComparable)

Vyhledá celou seřazenou ReadOnlySpan<T> hodnotu pomocí zadaného TComparable obecného typu.

BinarySearch<T,TComparer>(ReadOnlySpan<T>, T, TComparer)

Vyhledá celou seřazenou ReadOnlySpan<T> hodnotu pomocí zadaného TComparer obecného typu.

BinarySearch<T,TComparer>(Span<T>, T, TComparer)

Vyhledá celou seřazenou Span<T> hodnotu pomocí zadaného TComparer obecného typu.

BinarySearch<T>(ReadOnlySpan<T>, IComparable<T>)

Vyhledá celou hodnotu seřazenou ReadOnlySpan<T> pomocí zadaného IComparable<T> obecného rozhraní.

BinarySearch<T>(Span<T>, IComparable<T>)

Vyhledá celou hodnotu seřazenou Span<T> pomocí zadaného IComparable<T> obecného rozhraní.

BinarySearch<T,TComparable>(Span<T>, TComparable)

Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs

Vyhledá celou seřazenou Span<T> hodnotu pomocí zadaného TComparable obecného typu.

public:
generic <typename T, typename TComparable>
 where TComparable : IComparable<T>[System::Runtime::CompilerServices::Extension]
 static int BinarySearch(Span<T> span, TComparable comparable);
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int BinarySearch<T,TComparable>(this Span<T> span, TComparable comparable) where TComparable : IComparable<T>, allows ref struct;
public static int BinarySearch<T,TComparable>(this Span<T> span, TComparable comparable) where TComparable : IComparable<T>;
public static int BinarySearch<T,TComparable>(this Span<T> span, TComparable comparable) where TComparable : IComparable<T>, allows ref struct;
[<System.Runtime.CompilerServices.OverloadResolutionPriority(-1)>]
static member BinarySearch : Span<'T> * 'Comparable -> int (requires 'Comparable :> IComparable<'T>)
static member BinarySearch : Span<'T> * 'Comparable -> int (requires 'Comparable :> IComparable<'T>)
<Extension()>
Public Function BinarySearch(Of T, TComparable) (span As Span(Of T), comparable As TComparable) As Integer

Parametry typu

T

Typ prvku rozsahu.

TComparable

Konkrétní typ IComparable<T>.

Parametry

span
Span<T>

Seřazené Span<T> pro hledání.

comparable
TComparable

Použití TComparable při porovnávání.

Návraty

Index comparable založený na nule v seřazené span, pokud comparable je nalezen; v opačném případě záporné číslo, které je bitový doplněk indexu dalšího prvku, který je větší než comparable nebo, pokud neexistuje větší prvek, bitový doplněk Length.

Atributy

Výjimky

comparable je null.

Platí pro

BinarySearch<T,TComparable>(ReadOnlySpan<T>, TComparable)

Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs

Vyhledá celou seřazenou ReadOnlySpan<T> hodnotu pomocí zadaného TComparable obecného typu.

public:
generic <typename T, typename TComparable>
 where TComparable : IComparable<T>[System::Runtime::CompilerServices::Extension]
 static int BinarySearch(ReadOnlySpan<T> span, TComparable comparable);
public static int BinarySearch<T,TComparable>(this ReadOnlySpan<T> span, TComparable comparable) where TComparable : IComparable<T>, allows ref struct;
public static int BinarySearch<T,TComparable>(this ReadOnlySpan<T> span, TComparable comparable) where TComparable : IComparable<T>;
static member BinarySearch : ReadOnlySpan<'T> * 'Comparable -> int (requires 'Comparable :> IComparable<'T>)
<Extension()>
Public Function BinarySearch(Of T, TComparable) (span As ReadOnlySpan(Of T), comparable As TComparable) As Integer

Parametry typu

T

Typ prvku rozsahu.

TComparable

Konkrétní typ IComparable<T>.

Parametry

span
ReadOnlySpan<T>

Seřazené ReadOnlySpan<T> pro hledání.

comparable
TComparable

Použití TComparable při porovnávání.

Návraty

Index comparable založený na nule v seřazené span, pokud comparable je nalezen; v opačném případě záporné číslo, které je bitový doplněk indexu dalšího prvku, který je větší než comparable nebo, pokud neexistuje větší prvek, bitový doplněk Length.

Výjimky

comparable je null.

Platí pro

BinarySearch<T,TComparer>(ReadOnlySpan<T>, T, TComparer)

Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs

Vyhledá celou seřazenou ReadOnlySpan<T> hodnotu pomocí zadaného TComparer obecného typu.

public:
generic <typename T, typename TComparer>
 where TComparer : System::Collections::Generic::IComparer<T>[System::Runtime::CompilerServices::Extension]
 static int BinarySearch(ReadOnlySpan<T> span, T value, TComparer comparer);
public static int BinarySearch<T,TComparer>(this ReadOnlySpan<T> span, T value, TComparer comparer) where TComparer : System.Collections.Generic.IComparer<T>, allows ref struct;
public static int BinarySearch<T,TComparer>(this ReadOnlySpan<T> span, T value, TComparer comparer) where TComparer : System.Collections.Generic.IComparer<T>;
static member BinarySearch : ReadOnlySpan<'T> * 'T * 'Comparer -> int (requires 'Comparer :> System.Collections.Generic.IComparer<'T>)
<Extension()>
Public Function BinarySearch(Of T, TComparer) (span As ReadOnlySpan(Of T), value As T, comparer As TComparer) As Integer

Parametry typu

T

Typ prvku rozsahu.

TComparer

Konkrétní typ IComparer<T>.

Parametry

span
ReadOnlySpan<T>

Seřazené ReadOnlySpan<T> pro hledání.

value
T

Objekt, který chcete najít. Hodnota může být null pro odkazové typy.

comparer
TComparer

Použití TComparer při porovnávání.

Návraty

Index value založený na nule v seřazené span, pokud value je nalezen; v opačném případě záporné číslo, které je bitový doplněk indexu dalšího prvku, který je větší než value nebo, pokud neexistuje větší prvek, bitový doplněk Length.

Výjimky

comparer je null.

Platí pro

BinarySearch<T,TComparer>(Span<T>, T, TComparer)

Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs

Vyhledá celou seřazenou Span<T> hodnotu pomocí zadaného TComparer obecného typu.

public:
generic <typename T, typename TComparer>
 where TComparer : System::Collections::Generic::IComparer<T>[System::Runtime::CompilerServices::Extension]
 static int BinarySearch(Span<T> span, T value, TComparer comparer);
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int BinarySearch<T,TComparer>(this Span<T> span, T value, TComparer comparer) where TComparer : System.Collections.Generic.IComparer<T>, allows ref struct;
public static int BinarySearch<T,TComparer>(this Span<T> span, T value, TComparer comparer) where TComparer : System.Collections.Generic.IComparer<T>;
public static int BinarySearch<T,TComparer>(this Span<T> span, T value, TComparer comparer) where TComparer : System.Collections.Generic.IComparer<T>, allows ref struct;
[<System.Runtime.CompilerServices.OverloadResolutionPriority(-1)>]
static member BinarySearch : Span<'T> * 'T * 'Comparer -> int (requires 'Comparer :> System.Collections.Generic.IComparer<'T>)
static member BinarySearch : Span<'T> * 'T * 'Comparer -> int (requires 'Comparer :> System.Collections.Generic.IComparer<'T>)
<Extension()>
Public Function BinarySearch(Of T, TComparer) (span As Span(Of T), value As T, comparer As TComparer) As Integer

Parametry typu

T

Typ prvku rozsahu.

TComparer

Konkrétní typ IComparer<T>.

Parametry

span
Span<T>

Seřazené Span<T> pro hledání.

value
T

Objekt, který chcete najít. Hodnota může být null pro odkazové typy.

comparer
TComparer

Použití TComparer při porovnávání.

Návraty

Index value založený na nule v seřazené span, pokud value je nalezen; v opačném případě záporné číslo, které je bitový doplněk indexu dalšího prvku, který je větší než value nebo, pokud neexistuje větší prvek, bitový doplněk Length.

Atributy

Výjimky

comparer je null.

Platí pro

BinarySearch<T>(ReadOnlySpan<T>, IComparable<T>)

Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs

Vyhledá celou hodnotu seřazenou ReadOnlySpan<T> pomocí zadaného IComparable<T> obecného rozhraní.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static int BinarySearch(ReadOnlySpan<T> span, IComparable<T> ^ comparable);
public static int BinarySearch<T>(this ReadOnlySpan<T> span, IComparable<T> comparable);
static member BinarySearch : ReadOnlySpan<'T> * IComparable<'T> -> int
<Extension()>
Public Function BinarySearch(Of T) (span As ReadOnlySpan(Of T), comparable As IComparable(Of T)) As Integer

Parametry typu

T

Typ prvku rozsahu.

Parametry

span
ReadOnlySpan<T>

Seřazené ReadOnlySpan<T> pro hledání.

comparable
IComparable<T>

Použití IComparable<T> při porovnávání.

Návraty

Index comparable založený na nule v seřazené span, pokud comparable je nalezen; v opačném případě záporné číslo, které je bitový doplněk indexu dalšího prvku, který je větší než comparable nebo, pokud neexistuje větší prvek, bitový doplněk Length.

Výjimky

comparable je null.

Platí pro

BinarySearch<T>(Span<T>, IComparable<T>)

Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs
Zdroj:
MemoryExtensions.cs

Vyhledá celou hodnotu seřazenou Span<T> pomocí zadaného IComparable<T> obecného rozhraní.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static int BinarySearch(Span<T> span, IComparable<T> ^ comparable);
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int BinarySearch<T>(this Span<T> span, IComparable<T> comparable);
public static int BinarySearch<T>(this Span<T> span, IComparable<T> comparable);
[<System.Runtime.CompilerServices.OverloadResolutionPriority(-1)>]
static member BinarySearch : Span<'T> * IComparable<'T> -> int
static member BinarySearch : Span<'T> * IComparable<'T> -> int
<Extension()>
Public Function BinarySearch(Of T) (span As Span(Of T), comparable As IComparable(Of T)) As Integer

Parametry typu

T

Typ prvku rozsahu.

Parametry

span
Span<T>

Seřazené Span<T> pro hledání.

comparable
IComparable<T>

Použití IComparable<T> při porovnávání.

Návraty

Index comparable založený na nule v seřazené span, pokud comparable je nalezen; v opačném případě záporné číslo, které je bitový doplněk indexu dalšího prvku, který je větší než comparable nebo, pokud neexistuje větší prvek, bitový doplněk Length.

Atributy

Výjimky

comparable je null.

Platí pro