Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // Arreglo para probar
  2. int[] arreglo = {5, 7, 11, 20, 21, 25, 80, 85, 90, 95, 97, 98, 115, 500, 510, 512, 1024};
  3.  
  4. int busqueda = 500;
  5. // Ahora con la que usa el ciclo while
  6. int indiceDelElementoBuscado = busquedaBinariaConWhile(arreglo, busqueda);
  7. System.out.println("[Con ciclo While] -- El elemento buscado (" + String.valueOf(busqueda) + ") se encuentra en el index " + indiceDelElementoBuscado);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement