Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Arreglo para probar
- int[] arreglo = {5, 7, 11, 20, 21, 25, 80, 85, 90, 95, 97, 98, 115, 500, 510, 512, 1024};
- int busqueda = 500;
- // Ahora con la que usa el ciclo while
- int indiceDelElementoBuscado = busquedaBinariaConWhile(arreglo, busqueda);
- 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