Skip to content · ⁨Passer au contenu⁩

Binary search · ⁨Recherche binaire⁩

English

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.

Français

Recherche binaire

Le tableau est trié et contient n éléments. Retournez l'indice de target, ou -1 s'il n'est pas présent. Gardez lo et hi bornes, vérifiez le milieu à chaque étape, et éliminez la moitié qui ne peut pas contenir la cible.

Log in or create account · ⁨Se connecter ou créer un compte⁩

IGCSE, A-Level & AP