طريقة System::Array::BinarySearch

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

ينفّذ بحثًا ثنائيًا في المصفوفة المرتبة.

static int System::Array<T>::BinarySearch(System::ArrayPtr<T> arr, const T &item)
ParameterTypeالوصف
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)

انظر أيضًا