Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. """
  2. Probar con arreglo numérico
  3. """
  4. arreglo = [1, 2, 3, 10, 50, 80, 120, 150, 500, 1000]
  5. print("Vamos a buscar en la siguiente lista:", arreglo)
  6. busqueda = 500
  7. indice = busqueda_binaria_recursiva(arreglo, busqueda, 0, len(arreglo) - 1)
  8. print("El elemento {} está en el índice {}".format(busqueda, indice))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement