Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 7, 2019 17:08
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/73e6652d5d4fd9c12b4e26a4db0dc6a5 to your computer and use it in GitHub Desktop.
Save parzibyte/73e6652d5d4fd9c12b4e26a4db0dc6a5 to your computer and use it in GitHub Desktop.
// Probar el algoritmo
const arreglo = [1, 2, 5, 8, 10, 11, 11, 16, 20, 80, 500, 500, 1000, 1002, 5000],
busqueda = 20;
const indice = busquedaBinaria(arreglo, busqueda);
console.log("El valor %s está en el índice %d", busqueda, indice);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment