Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 7, 2019 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/12d160198457dbdc3d3877abdfef414e to your computer and use it in GitHub Desktop.
Save parzibyte/12d160198457dbdc3d3877abdfef414e to your computer and use it in GitHub Desktop.
<?php
$arreglo = [1, 5, 40, 45, 58, 77, 80, 200, 250];
$busqueda = 200;
$izquierda = 0;
$derecha = count($arreglo) - 1;
$indice = busquedaBinariaRecursiva($arreglo, $busqueda, $izquierda, $derecha);
echo "El elemento $busqueda está en el índice $indice";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment