ArrayList.BinarySearch Methode
Definition
Überlädt
BinarySearch(Object) |
Durchsucht mithilfe des Standardcomparers die gesamte sortierte ArrayList nach einem Element und gibt den nullbasierten Index des Elements zurück.Searches the entire sorted ArrayList for an element using the default comparer and returns the zero-based index of the element. |
BinarySearch(Object, IComparer) |
Durchsucht mithilfe des angegebenen Comparers die gesamte sortierte ArrayList nach einem Element und gibt den nullbasierten Index des Elements zurück.Searches the entire sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element. |
BinarySearch(Int32, Int32, Object, IComparer) |
Durchsucht mithilfe des angegebenen Vergleichs einen Bereich von Elementen in der sortierten ArrayList nach einem Element und gibt den nullbasierten Index des Elements zurück.Searches a range of elements in the sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element. |
BinarySearch(Object)
public:
virtual int BinarySearch(System::Object ^ value);
public virtual int BinarySearch (object value);
public virtual int BinarySearch (object? value);
abstract member BinarySearch : obj -> int
override this.BinarySearch : obj -> int
Public Overridable Function BinarySearch (value As Object) As Integer
Parameter
- value
- Object
Die zu suchende Object.The Object to locate. Der Wert kann null
sein.The value can be null
.
Gibt zurück
Der nullbasierte Index von value
in der sortierten ArrayList, sofern value
gefunden wird, andernfalls eine negative Zahl, die das bitweise Komplement des Indexes des nächsten Elements darstellt, das größer als value
ist, oder, wenn es kein größeres Element gibt, das bitweise Komplement von Count.The zero-based index of value
in the sorted ArrayList, if value
is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value
or, if there is no larger element, the bitwise complement of Count.
Ausnahmen
Weder value
noch die Elemente von ArrayList implementieren die IComparable-Schnittstelle.Neither value
nor the elements of ArrayList implement the IComparable interface.
value
ist nicht vom gleichen Typ wie die Elemente der ArrayList.value
is not of the same type as the elements of the ArrayList.
Beispiele
Im folgenden Codebeispiel wird gezeigt, wie verwendet wird, BinarySearch um ein bestimmtes-Objekt in der zu suchen ArrayList .The following code example shows how to use BinarySearch to locate a specific object in the ArrayList.
using namespace System;
using namespace System::Collections;
void FindMyObject( ArrayList^ myList, Object^ myObject );
void PrintValues( IEnumerable^ myList );
int main()
{
// Creates and initializes a new ArrayList. BinarySearch requires
// a sorted ArrayList.
ArrayList^ myAL = gcnew ArrayList;
for ( int i = 0; i <= 4; i++ )
myAL->Add( i * 2 );
// Displays the ArrayList.
Console::WriteLine( "The Int32 ArrayList contains the following:" );
PrintValues( myAL );
// Locates a specific object that does not exist in the ArrayList.
Object^ myObjectOdd = 3;
FindMyObject( myAL, myObjectOdd );
// Locates an object that exists in the ArrayList.
Object^ myObjectEven = 6;
FindMyObject( myAL, myObjectEven );
}
void FindMyObject( ArrayList^ myList, Object^ myObject )
{
int myIndex = myList->BinarySearch( myObject );
if ( myIndex < 0 )
Console::WriteLine( "The object to search for ({0}) is not found. The next larger object is at index {1}.", myObject, ~myIndex );
else
Console::WriteLine( "The object to search for ({0}) is at index {1}.", myObject, myIndex );
}
void PrintValues( IEnumerable^ myList )
{
IEnumerator^ myEnum = myList->GetEnumerator();
while ( myEnum->MoveNext() )
{
Object^ obj = safe_cast<Object^>(myEnum->Current);
Console::Write( " {0}", obj );
}
Console::WriteLine();
}
/*
This code produces the following output.
The Int32 ArrayList contains the following:
0 2 4 6 8
The object to search for (3) is not found. The next larger object is at index 2.
The object to search for (6) is at index 3.
*/
using System;
using System.Collections;
public class SamplesArrayList {
public static void Main() {
// Creates and initializes a new ArrayList. BinarySearch requires
// a sorted ArrayList.
ArrayList myAL = new ArrayList();
for ( int i = 0; i <= 4; i++ )
myAL.Add( i*2 );
// Displays the ArrayList.
Console.WriteLine( "The Int32 ArrayList contains the following:" );
PrintValues( myAL );
// Locates a specific object that does not exist in the ArrayList.
Object myObjectOdd = 3;
FindMyObject( myAL, myObjectOdd );
// Locates an object that exists in the ArrayList.
Object myObjectEven = 6;
FindMyObject( myAL, myObjectEven );
}
public static void FindMyObject( ArrayList myList, Object myObject ) {
int myIndex=myList.BinarySearch( myObject );
if ( myIndex < 0 )
Console.WriteLine( "The object to search for ({0}) is not found. The next larger object is at index {1}.", myObject, ~myIndex );
else
Console.WriteLine( "The object to search for ({0}) is at index {1}.", myObject, myIndex );
}
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.Write( " {0}", obj );
Console.WriteLine();
}
}
/*
This code produces the following output.
The Int32 ArrayList contains the following:
0 2 4 6 8
The object to search for (3) is not found. The next larger object is at index 2.
The object to search for (6) is at index 3.
*/
Imports System.Collections
Public Class SamplesArrayList
Public Shared Sub Main()
' Creates and initializes a new ArrayList. BinarySearch requires
' a sorted ArrayList.
Dim myAL As New ArrayList()
Dim i As Integer
For i = 0 To 4
myAL.Add(i * 2)
Next i
' Displays the ArrayList.
Console.WriteLine("The Int32 ArrayList contains the following:")
PrintValues(myAL)
' Locates a specific object that does not exist in the ArrayList.
Dim myObjectOdd As Object = 3
FindMyObject(myAL, myObjectOdd)
' Locates an object that exists in the ArrayList.
Dim myObjectEven As Object = 6
FindMyObject(myAL, myObjectEven)
End Sub
Public Shared Sub FindMyObject(myList As ArrayList, myObject As Object)
Dim myIndex As Integer = myList.BinarySearch(myObject)
If myIndex < 0 Then
Console.WriteLine("The object to search for ({0}) is not found. " _
+ "The next larger object is at index {1}.", myObject, _
Not myIndex)
Else
Console.WriteLine("The object to search for ({0}) is at index " _
+ "{1}.", myObject, myIndex)
End If
End Sub
Public Shared Sub PrintValues(myList As IEnumerable)
Dim obj As [Object]
For Each obj In myList
Console.Write(" {0}", obj)
Next obj
Console.WriteLine()
End Sub
End Class
' This code produces the following output.
'
' The Int32 ArrayList contains the following:
' 0 2 4 6 8
' The object to search for (3) is not found. The next larger object is at index 2.
' The object to search for (6) is at index 3.
Hinweise
Der value
-Parameter und jedes-Element von ArrayList müssen die- IComparable Schnittstelle implementieren, die für Vergleiche verwendet wird.The value
parameter and each element of the ArrayList must implement the IComparable interface, which is used for comparisons. Die Elemente der ArrayList müssen bereits in einem zunehmenden Wert entsprechend der von der-Implementierung definierten Sortierreihenfolge sortiert werden IComparable . andernfalls ist das Ergebnis möglicherweise falsch.The elements of the ArrayList must already be sorted in increasing value according to the sort order defined by the IComparable implementation; otherwise, the result might be incorrect.
null
Der Vergleich mit einem beliebigen Typ ist zulässig und generiert bei Verwendung von keine Ausnahme IComparable .Comparing null
with any type is allowed and does not generate an exception when using IComparable. Beim Sortieren null
wird als kleiner als ein beliebiges anderes Objekt betrachtet.When sorting, null
is considered to be less than any other object.
Wenn ArrayList mehr als ein Element mit dem gleichen Wert enthält, gibt die Methode nur eine der Vorkommen zurück, und Sie gibt möglicherweise eine der Vorkommen zurück, nicht notwendigerweise die erste.If the ArrayList contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one.
Wenn das den ArrayList angegebenen Wert nicht enthält, gibt die Methode eine negative Ganzzahl zurück.If the ArrayList does not contain the specified value, the method returns a negative integer. Sie können die bitweise Komplement Operation (~) auf diese negative Ganzzahl anwenden, um den Index des ersten Elements, das größer als der Suchwert ist, zu erhalten.You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. Wenn Sie den Wert in das Einfügen ArrayList , sollte dieser Index als Einfügemarke zum Beibehalten der Sortierreihenfolge verwendet werden.When inserting the value into the ArrayList, this index should be used as the insertion point to maintain the sort order.
Diese Methode ist ein O(log n)
Vorgang, bei dem gleich n
ist Count .This method is an O(log n)
operation, where n
is Count.
Siehe auch
Gilt für:
BinarySearch(Object, IComparer)
public:
virtual int BinarySearch(System::Object ^ value, System::Collections::IComparer ^ comparer);
public virtual int BinarySearch (object value, System.Collections.IComparer comparer);
public virtual int BinarySearch (object? value, System.Collections.IComparer? comparer);
abstract member BinarySearch : obj * System.Collections.IComparer -> int
override this.BinarySearch : obj * System.Collections.IComparer -> int
Public Overridable Function BinarySearch (value As Object, comparer As IComparer) As Integer
Parameter
- value
- Object
Die zu suchende Object.The Object to locate. Der Wert kann null
sein.The value can be null
.
- comparer
- IComparer
Die IComparer-Implementierung, die beim Vergleich von Elementen verwendet werden soll.The IComparer implementation to use when comparing elements.
- oder --or-
null
, wenn der Standardvergleich verwendet werden soll. Dies ist die IComparable-Implementierung des jeweiligen Elements.null
to use the default comparer that is the IComparable implementation of each element.
Gibt zurück
Der nullbasierte Index von value
in der sortierten ArrayList, sofern value
gefunden wird, andernfalls eine negative Zahl, die das bitweise Komplement des Indexes des nächsten Elements darstellt, das größer als value
ist, oder, wenn es kein größeres Element gibt, das bitweise Komplement von Count.The zero-based index of value
in the sorted ArrayList, if value
is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value
or, if there is no larger element, the bitwise complement of Count.
Ausnahmen
comparer
ist null
und weder value
noch die Elemente von ArrayList implementieren die IComparable-Schnittstelle.comparer
is null
and neither value
nor the elements of ArrayList implement the IComparable interface.
comparer
ist null
und value
ist nicht vom gleichen Typ wie die Elemente von ArrayList.comparer
is null
and value
is not of the same type as the elements of the ArrayList.
Beispiele
Im folgenden Beispiel wird eine ArrayList von farbigen-animals erstellt.The following example creates an ArrayList of colored animals. Der bereitgestellte IComparer führt den Zeichen folgen Vergleich für die binäre Suche aus.The provided IComparer performs the string comparison for the binary search. Die Ergebnisse einer iterativen Suche und einer binären Suche werden angezeigt.The results of both an iterative search and a binary search are displayed.
using namespace System;
using namespace System::Collections;
public ref class SimpleStringComparer : public IComparer
{
virtual int Compare(Object^ x, Object^ y) sealed = IComparer::Compare
{
String^ cmpstr = (String^)x;
return cmpstr->CompareTo((String^)y);
}
};
public ref class MyArrayList : public ArrayList
{
public:
static void Main()
{
// Creates and initializes a new ArrayList.
MyArrayList^ coloredAnimals = gcnew MyArrayList();
coloredAnimals->Add("White Tiger");
coloredAnimals->Add("Pink Bunny");
coloredAnimals->Add("Red Dragon");
coloredAnimals->Add("Green Frog");
coloredAnimals->Add("Blue Whale");
coloredAnimals->Add("Black Cat");
coloredAnimals->Add("Yellow Lion");
// BinarySearch requires a sorted ArrayList.
coloredAnimals->Sort();
// Compare results of an iterative search with a binary search
int index = coloredAnimals->IterativeSearch("White Tiger");
Console::WriteLine("Iterative search, item found at index: {0}", index);
index = coloredAnimals->BinarySearch("White Tiger", gcnew SimpleStringComparer());
Console::WriteLine("Binary search, item found at index: {0}", index);
}
int IterativeSearch(Object^ finditem)
{
int index = -1;
for (int i = 0; i < this->Count; i++)
{
if (finditem->Equals(this[i]))
{
index = i;
break;
}
}
return index;
}
};
int main()
{
MyArrayList::Main();
}
//
// This code produces the following output.
//
// Iterative search, item found at index: 5
// Binary search, item found at index: 5
//
using System;
using System.Collections;
public class SimpleStringComparer : IComparer
{
int IComparer.Compare(object x, object y)
{
string cmpstr = (string)x;
return cmpstr.CompareTo((string)y);
}
}
public class MyArrayList : ArrayList
{
public static void Main()
{
// Creates and initializes a new ArrayList.
MyArrayList coloredAnimals = new MyArrayList();
coloredAnimals.Add("White Tiger");
coloredAnimals.Add("Pink Bunny");
coloredAnimals.Add("Red Dragon");
coloredAnimals.Add("Green Frog");
coloredAnimals.Add("Blue Whale");
coloredAnimals.Add("Black Cat");
coloredAnimals.Add("Yellow Lion");
// BinarySearch requires a sorted ArrayList.
coloredAnimals.Sort();
// Compare results of an iterative search with a binary search
int index = coloredAnimals.IterativeSearch("White Tiger");
Console.WriteLine("Iterative search, item found at index: {0}", index);
index = coloredAnimals.BinarySearch("White Tiger", new SimpleStringComparer());
Console.WriteLine("Binary search, item found at index: {0}", index);
}
public int IterativeSearch(object finditem)
{
int index = -1;
for (int i = 0; i < this.Count; i++)
{
if (finditem.Equals(this[i]))
{
index = i;
break;
}
}
return index;
}
}
//
// This code produces the following output.
//
// Iterative search, item found at index: 5
// Binary search, item found at index: 5
//
Imports System.Collections
Public Class SimpleStringComparer
Implements IComparer
Function Compare(x As Object, y As Object) As Integer Implements IComparer.Compare
Dim cmpstr As String = CType(x, String)
Return cmpstr.CompareTo(CType(y, String))
End Function
End Class
Public Class MyArrayList
Inherits ArrayList
Public Shared Sub Main()
' Creates and initializes a new ArrayList.
Dim coloredAnimals As New MyArrayList()
coloredAnimals.Add("White Tiger")
coloredAnimals.Add("Pink Bunny")
coloredAnimals.Add("Red Dragon")
coloredAnimals.Add("Green Frog")
coloredAnimals.Add("Blue Whale")
coloredAnimals.Add("Black Cat")
coloredAnimals.Add("Yellow Lion")
' BinarySearch requires a sorted ArrayList.
coloredAnimals.Sort()
' Compare results of an iterative search with a binary search
Dim index As Integer = coloredAnimals.IterativeSearch("White Tiger")
Console.WriteLine("Iterative search, item found at index: {0}", index)
index = coloredAnimals.BinarySearch("White Tiger", New SimpleStringComparer())
Console.WriteLine("Binary search, item found at index: {0}", index)
End Sub
Public Function IterativeSearch(finditem As Object) As Integer
Dim index As Integer = -1
For i As Integer = 0 To MyClass.Count - 1
If finditem.Equals(MyClass.Item(i))
index = i
Exit For
End If
Next i
Return index
End Function
End Class
'
' This code produces the following output.
'
' Iterative search, item found at index: 5
' Binary search, item found at index: 5
'
Hinweise
Der Vergleich passt an, wie die Elemente verglichen werden.The comparer customizes how the elements are compared. Beispielsweise können Sie eine- CaseInsensitiveComparer Instanz als Vergleichs Operator verwenden, um Zeichen folgen suchen ohne Berücksichtigung der Groß-/Kleinschreibung auszuführen.For example, you can use a CaseInsensitiveComparer instance as the comparer to perform case-insensitive string searches.
Wenn comparer
angegeben wird, werden die Elemente der ArrayList mithilfe der angegebenen-Implementierung mit dem angegebenen Wert verglichen IComparer .If comparer
is provided, the elements of the ArrayList are compared to the specified value using the specified IComparer implementation. Die Elemente der ArrayList müssen bereits nach der von definierten Sortierreihenfolge in einem zunehmenden Wert sortiert werden comparer
. andernfalls ist das Ergebnis möglicherweise falsch.The elements of the ArrayList must already be sorted in increasing value according to the sort order defined by comparer
; otherwise, the result might be incorrect.
Wenn comparer
null
den Wert hat, erfolgt der Vergleich mithilfe der-Implementierung, die IComparable vom-Element selbst oder durch den angegebenen-Wert bereitgestellt wird.If comparer
is null
, the comparison is done using the IComparable implementation provided by the element itself or by the specified value. Die Elemente der ArrayList müssen bereits in einem zunehmenden Wert entsprechend der von der-Implementierung definierten Sortierreihenfolge sortiert werden IComparable . andernfalls ist das Ergebnis möglicherweise falsch.The elements of the ArrayList must already be sorted in increasing value according to the sort order defined by the IComparable implementation; otherwise, the result might be incorrect.
null
Der Vergleich mit einem beliebigen Typ ist zulässig und generiert bei Verwendung von keine Ausnahme IComparable .Comparing null
with any type is allowed and does not generate an exception when using IComparable. Beim Sortieren null
wird als kleiner als ein beliebiges anderes Objekt betrachtet.When sorting, null
is considered to be less than any other object.
Wenn ArrayList mehr als ein Element mit dem gleichen Wert enthält, gibt die Methode nur eine der Vorkommen zurück, und Sie gibt möglicherweise eine der Vorkommen zurück, nicht notwendigerweise die erste.If the ArrayList contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one.
Wenn das den ArrayList angegebenen Wert nicht enthält, gibt die Methode eine negative Ganzzahl zurück.If the ArrayList does not contain the specified value, the method returns a negative integer. Sie können die bitweise Komplement Operation (~) auf diese negative Ganzzahl anwenden, um den Index des ersten Elements, das größer als der Suchwert ist, zu erhalten.You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. Wenn Sie den Wert in das Einfügen ArrayList , sollte dieser Index als Einfügemarke zum Beibehalten der Sortierreihenfolge verwendet werden.When inserting the value into the ArrayList, this index should be used as the insertion point to maintain the sort order.
Diese Methode ist ein O(log n)
Vorgang, bei dem gleich n
ist Count .This method is an O(log n)
operation, where n
is Count.
Siehe auch
Gilt für:
BinarySearch(Int32, Int32, Object, IComparer)
Durchsucht mithilfe des angegebenen Vergleichs einen Bereich von Elementen in der sortierten ArrayList nach einem Element und gibt den nullbasierten Index des Elements zurück.Searches a range of elements in the sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.
public:
virtual int BinarySearch(int index, int count, System::Object ^ value, System::Collections::IComparer ^ comparer);
public virtual int BinarySearch (int index, int count, object value, System.Collections.IComparer comparer);
public virtual int BinarySearch (int index, int count, object? value, System.Collections.IComparer? comparer);
abstract member BinarySearch : int * int * obj * System.Collections.IComparer -> int
override this.BinarySearch : int * int * obj * System.Collections.IComparer -> int
Public Overridable Function BinarySearch (index As Integer, count As Integer, value As Object, comparer As IComparer) As Integer
Parameter
- index
- Int32
Der nullbasierte Startindex des zu durchsuchenden Bereichs.The zero-based starting index of the range to search.
- count
- Int32
Die Länge des zu durchsuchenden Bereichs.The length of the range to search.
- value
- Object
Die zu suchende Object.The Object to locate. Der Wert kann null
sein.The value can be null
.
- comparer
- IComparer
Die IComparer-Implementierung, die beim Vergleich von Elementen verwendet werden soll.The IComparer implementation to use when comparing elements.
- oder --or-
null
, wenn der Standardvergleich verwendet werden soll. Dies ist die IComparable-Implementierung des jeweiligen Elements.null
to use the default comparer that is the IComparable implementation of each element.
Gibt zurück
Der nullbasierte Index von value
in der sortierten ArrayList, sofern value
gefunden wird, andernfalls eine negative Zahl, die das bitweise Komplement des Indexes des nächsten Elements darstellt, das größer als value
ist, oder, wenn es kein größeres Element gibt, das bitweise Komplement von Count.The zero-based index of value
in the sorted ArrayList, if value
is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value
or, if there is no larger element, the bitwise complement of Count.
Ausnahmen
index
und count
geben keinen gültigen Bereich in der ArrayList an.index
and count
do not denote a valid range in the ArrayList.
- oder --or-
comparer
ist null
und weder value
noch die Elemente von ArrayList implementieren die IComparable-Schnittstelle.comparer
is null
and neither value
nor the elements of ArrayList implement the IComparable interface.
comparer
ist null
und value
ist nicht vom gleichen Typ wie die Elemente von ArrayList.comparer
is null
and value
is not of the same type as the elements of the ArrayList.
index
ist kleiner als Null.index
is less than zero.
- oder --or-
count
ist kleiner als Null.count
is less than zero.
Hinweise
Der Vergleich passt an, wie die Elemente verglichen werden.The comparer customizes how the elements are compared. Beispielsweise können Sie eine- CaseInsensitiveComparer Instanz als Vergleichs Operator verwenden, um Zeichen folgen suchen ohne Berücksichtigung der Groß-/Kleinschreibung auszuführen.For example, you can use a CaseInsensitiveComparer instance as the comparer to perform case-insensitive string searches.
Wenn comparer
angegeben wird, werden die Elemente der ArrayList mithilfe der angegebenen-Implementierung mit dem angegebenen Wert verglichen IComparer .If comparer
is provided, the elements of the ArrayList are compared to the specified value using the specified IComparer implementation. Die Elemente der ArrayList müssen bereits nach der von definierten Sortierreihenfolge in einem zunehmenden Wert sortiert werden comparer
. andernfalls ist das Ergebnis möglicherweise falsch.The elements of the ArrayList must already be sorted in increasing value according to the sort order defined by comparer
; otherwise, the result might be incorrect.
Wenn comparer
null
den Wert hat, erfolgt der Vergleich mithilfe der-Implementierung, die IComparable vom-Element selbst oder durch den angegebenen-Wert bereitgestellt wird.If comparer
is null
, the comparison is done using the IComparable implementation provided by the element itself or by the specified value. Die Elemente der ArrayList müssen bereits in einem zunehmenden Wert entsprechend der von der-Implementierung definierten Sortierreihenfolge sortiert werden IComparable . andernfalls ist das Ergebnis möglicherweise falsch.The elements of the ArrayList must already be sorted in increasing value according to the sort order defined by the IComparable implementation; otherwise, the result might be incorrect.
null
Der Vergleich mit einem beliebigen Typ ist zulässig und generiert bei Verwendung von keine Ausnahme IComparable .Comparing null
with any type is allowed and does not generate an exception when using IComparable. Beim Sortieren null
wird als kleiner als ein beliebiges anderes Objekt betrachtet.When sorting, null
is considered to be less than any other object.
Wenn ArrayList mehr als ein Element mit dem gleichen Wert enthält, gibt die Methode nur eine der Vorkommen zurück, und Sie gibt möglicherweise eine der Vorkommen zurück, nicht notwendigerweise die erste.If the ArrayList contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one.
Wenn das den ArrayList angegebenen Wert nicht enthält, gibt die Methode eine negative Ganzzahl zurück.If the ArrayList does not contain the specified value, the method returns a negative integer. Sie können die bitweise Komplement Operation (~) auf diese negative Ganzzahl anwenden, um den Index des ersten Elements, das größer als der Suchwert ist, zu erhalten.You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. Wenn Sie den Wert in das Einfügen ArrayList , sollte dieser Index als Einfügemarke zum Beibehalten der Sortierreihenfolge verwendet werden.When inserting the value into the ArrayList, this index should be used as the insertion point to maintain the sort order.
Diese Methode ist ein O(log n)
Vorgang, bei dem gleich n
ist count
.This method is an O(log n)
operation, where n
is count
.
Siehe auch
- IComparer
- IComparable
- Durchführen kulturunabhängiger Zeichenfolgenoperationen in SammlungenPerforming Culture-Insensitive String Operations in Collections