Méthode System::Array::BinarySearch

Array::BinarySearch(System::ArrayPtr<T>, const T&) method

Effectue une recherche binaire dans le tableau trié.

static int System::Array<T>::BinarySearch(System::ArrayPtr<T> arr, const T &item)
ParamètreTypeDescription
arrSystem::ArrayPtr<T>Tableau trié dans lequel effectuer la recherche
itemconst T&Un élément à rechercher

ReturnValue

Indice de l’élément recherché s’il est trouvé, sinon, un entier négatif qui est le complément à un de l’indice du prochain élément supérieur à l’élément recherché ou, s’il n’existe aucun élément supérieur, le complément à un du nombre d’éléments du tableau.

Voir aussi

Array::BinarySearch(System::ArrayPtr<T>, const Y&, const SharedPtr<Collections::Generic::IComparer<Z>>&) method

NON IMPLEMENTÉ.

template<typename Y,typename Z> static int System::Array<T>::BinarySearch(System::ArrayPtr<T> arr, const Y &item, const SharedPtr<Collections::Generic::IComparer<Z>> &comparer)

Voir aussi