Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 7, 2019 16:53
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/c2653345e8d8bcec0e66b3761b7b9d61 to your computer and use it in GitHub Desktop.
Save parzibyte/c2653345e8d8bcec0e66b3761b7b9d61 to your computer and use it in GitHub Desktop.
"""
Probar con arreglo numérico
"""
arreglo = [1, 2, 3, 10, 50, 80, 120, 150, 500, 1000]
print("Vamos a buscar en la siguiente lista:", arreglo)
busqueda = 500
indice = busqueda_binaria_recursiva(arreglo, busqueda, 0, len(arreglo) - 1)
print("El elemento {} está en el índice {}".format(busqueda, indice))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment