Created
August 7, 2019 15:32
-
-
Save parzibyte/6b616fcc383da4ecc2eaa9145ec6ffeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int existeEnArreglo(int[] arreglo, int busqueda) { | |
for (int x = 0; x < arreglo.length; x++) { | |
if (arreglo[x] == busqueda) { | |
return x; | |
} | |
} | |
return -1; | |
} | |
public static int existeEnArreglo(String[] arreglo, String busqueda) { | |
for (int x = 0; x < arreglo.length; x++) { | |
if (arreglo[x].equals(busqueda)) { | |
return x; | |
} | |
} | |
return -1; | |
} | |
public static int existeEnArreglo(float[] arreglo, float busqueda) { | |
for (int x = 0; x < arreglo.length; x++) { | |
if (arreglo[x] == busqueda) { | |
return x; | |
} | |
} | |
return -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment