MemoryExtensions.BinarySearch Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Túlterhelések
| Név | Description |
|---|---|
| BinarySearch<T,TComparable>(Span<T>, TComparable) |
A megadott Span<T> általános típussal keres egy teljes rendezést |
| BinarySearch<T,TComparable>(ReadOnlySpan<T>, TComparable) |
A megadott ReadOnlySpan<T> általános típussal keres egy teljes rendezést |
| BinarySearch<T,TComparer>(ReadOnlySpan<T>, T, TComparer) |
Egy megadott értékre a megadott ReadOnlySpan<T> általános típussal keres egy teljes rendezést |
| BinarySearch<T,TComparer>(Span<T>, T, TComparer) |
Egy megadott értékre a megadott Span<T> általános típussal keres egy teljes rendezést |
| BinarySearch<T>(ReadOnlySpan<T>, IComparable<T>) |
A megadott ReadOnlySpan<T> általános felülettel keres egy teljes rendezésű IComparable<T> értéket. |
| BinarySearch<T>(Span<T>, IComparable<T>) |
A megadott Span<T> általános felülettel keres egy teljes rendezésű IComparable<T> értéket. |
BinarySearch<T,TComparable>(Span<T>, TComparable)
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
A megadott Span<T> általános típussal keres egy teljes rendezést TComparable egy értékre vonatkozóan.
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
Típusparaméterek
- T
A span elemtípusa.
- TComparable
Az adott típus IComparable<T>.
Paraméterek
- comparable
- TComparable
Az TComparable összehasonlításhoz használandó.
Válaszok
A rendezés nulla alapú indexe comparable , ha span található; ellenkező esetben negatív szám, amely a következő elem indexének bitenkénti kiegészítése, amely nagyobb, mint comparable vagy ha nincs nagyobb elem, akkor a bitenkénti kiegészítésecomparable.Length
- Attribútumok
Kivételek
comparable az null.
A következőre érvényes:
BinarySearch<T,TComparable>(ReadOnlySpan<T>, TComparable)
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
A megadott ReadOnlySpan<T> általános típussal keres egy teljes rendezést TComparable egy értékre vonatkozóan.
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
Típusparaméterek
- T
A span elemtípusa.
- TComparable
Az adott típus IComparable<T>.
Paraméterek
- span
- ReadOnlySpan<T>
A kereséshez rendezve ReadOnlySpan<T> .
- comparable
- TComparable
Az TComparable összehasonlításhoz használandó.
Válaszok
A rendezés nulla alapú indexe comparable , ha span található; ellenkező esetben negatív szám, amely a következő elem indexének bitenkénti kiegészítése, amely nagyobb, mint comparable vagy ha nincs nagyobb elem, akkor a bitenkénti kiegészítésecomparable.Length
Kivételek
comparable az null.
A következőre érvényes:
BinarySearch<T,TComparer>(ReadOnlySpan<T>, T, TComparer)
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
Egy megadott értékre a megadott ReadOnlySpan<T> általános típussal keres egy teljes rendezéstTComparer.
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
Típusparaméterek
- T
A span elemtípusa.
- TComparer
Az adott típus IComparer<T>.
Paraméterek
- span
- ReadOnlySpan<T>
A kereséshez rendezve ReadOnlySpan<T> .
- value
- T
A keresendő objektum. Az érték referenciatípusokra is lehet null .
- comparer
- TComparer
Az TComparer összehasonlításhoz használandó.
Válaszok
A rendezés nulla alapú indexe value , ha span található; ellenkező esetben negatív szám, amely a következő elem indexének bitenkénti kiegészítése, amely nagyobb, mint value vagy ha nincs nagyobb elem, akkor a bitenkénti kiegészítésevalue.Length
Kivételek
comparer az null.
A következőre érvényes:
BinarySearch<T,TComparer>(Span<T>, T, TComparer)
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
Egy megadott értékre a megadott Span<T> általános típussal keres egy teljes rendezéstTComparer.
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
Típusparaméterek
- T
A span elemtípusa.
- TComparer
Az adott típus IComparer<T>.
Paraméterek
- value
- T
A keresendő objektum. Az érték referenciatípusokra is lehet null .
- comparer
- TComparer
Az TComparer összehasonlításhoz használandó.
Válaszok
A rendezés nulla alapú indexe value , ha span található; ellenkező esetben negatív szám, amely a következő elem indexének bitenkénti kiegészítése, amely nagyobb, mint value vagy ha nincs nagyobb elem, akkor a bitenkénti kiegészítésevalue.Length
- Attribútumok
Kivételek
comparer az null.
A következőre érvényes:
BinarySearch<T>(ReadOnlySpan<T>, IComparable<T>)
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
A megadott ReadOnlySpan<T> általános felülettel keres egy teljes rendezésű IComparable<T> értéket.
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
Típusparaméterek
- T
A span elemtípusa.
Paraméterek
- span
- ReadOnlySpan<T>
A kereséshez rendezve ReadOnlySpan<T> .
- comparable
- IComparable<T>
Az IComparable<T> összehasonlításhoz használandó.
Válaszok
A rendezés nulla alapú indexe comparable , ha span található; ellenkező esetben negatív szám, amely a következő elem indexének bitenkénti kiegészítése, amely nagyobb, mint comparable vagy ha nincs nagyobb elem, akkor a bitenkénti kiegészítésecomparable.Length
Kivételek
comparable az null.
A következőre érvényes:
BinarySearch<T>(Span<T>, IComparable<T>)
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
- Forrás:
- MemoryExtensions.cs
A megadott Span<T> általános felülettel keres egy teljes rendezésű IComparable<T> értéket.
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
Típusparaméterek
- T
A span elemtípusa.
Paraméterek
- comparable
- IComparable<T>
Az IComparable<T> összehasonlításhoz használandó.
Válaszok
A rendezés nulla alapú indexe comparable , ha span található; ellenkező esetben negatív szám, amely a következő elem indexének bitenkénti kiegészítése, amely nagyobb, mint comparable vagy ha nincs nagyobb elem, akkor a bitenkénti kiegészítésecomparable.Length
- Attribútumok
Kivételek
comparable az null.