.NET Framework Class Library
Array..::.BinarySearch Method

Searches a one-dimensional sorted Array for a value, using a binary search algorithm.

Overload List

  NameDescription
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkBinarySearch(Array, Object)Searches an entire one-dimensional sorted Array for a specific element, using the IComparable interface implemented by each element of the Array and by the specified object.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkBinarySearch<(Of <(T>)>)(array<T>[]()[], T)Searches an entire one-dimensional sorted Array for a specific element, using the IComparable<(Of <(T>)>) generic interface implemented by each element of the Array and by the specified object.
Public methodStatic memberBinarySearch(Array, Object, IComparer)Searches an entire one-dimensional sorted Array for a value using the specified IComparer interface.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkBinarySearch<(Of <(T>)>)(array<T>[]()[], T, IComparer<(Of <(T>)>))Searches an entire one-dimensional sorted Array for a value using the specified IComparer<(Of <(T>)>) generic interface.
Public methodStatic memberBinarySearch(Array, Int32, Int32, Object)Searches a range of elements in a one-dimensional sorted Array for a value, using the IComparable interface implemented by each element of the Array and by the specified value.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkBinarySearch<(Of <(T>)>)(array<T>[]()[], Int32, Int32, T)Searches a range of elements in a one-dimensional sorted Array for a value, using the IComparable<(Of <(T>)>) generic interface implemented by each element of the Array and by the specified value.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkBinarySearch(Array, Int32, Int32, Object, IComparer)Searches a range of elements in a one-dimensional sorted Array for a value, using the specified IComparer interface.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkBinarySearch<(Of <(T>)>)(array<T>[]()[], Int32, Int32, T, IComparer<(Of <(T>)>))Searches a range of elements in a one-dimensional sorted Array for a value, using the specified IComparer<(Of <(T>)>) generic interface.
Top
See Also

Reference

Tags :


Community Content

aamoros
newbies: Make sure to sort your array prior to using Array.BinarySearch
Good Article

http://aspnet.4guysfromrolla.com/articles/110602-1.aspx

Page view tracker