System::Array::BinarySearch メソッド

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

ソート済み配列で二分探索を実行します。

static int System::Array<T>::BinarySearch(System::ArrayPtr<T> arr, const T &item)
パラメーター説明
arrSystem::ArrayPtr<T>検索を実行するソート済み配列
項目const T&検索対象の項目

ReturnValue

検索された項目が見つかった場合はそのインデックスを、見つからなかった場合は負の整数を返します。その負の整数は、検索項目より大きい次の項目のインデックスのビット単位の補数、または、より大きい項目が存在しない場合は配列の要素数のビット単位の補数です。

参照

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

未実装です。

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)

参照