Skip to content · ⁨الانتقال إلى المحتوى⁩

Binary search · ⁨البحث الثنائي⁩

Binary search

The array is sorted and has n elements. Return the index of target, or -1 if it isn't present. Keep lo and hi bounds, check the middle each step, and discard the half that can't contain the target.

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP