Created
March 2, 2017 03:40
-
-
Save heanfig/a93226095c172d4b7ea7b8d0815ad2c7 to your computer and use it in GitHub Desktop.
RecursiveIteration
This file contains hidden or 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 count (String line, char c) | |
{ | |
int len = line.length(); | |
if ((len == 0) || (c == '\0')){ | |
return 0; | |
} | |
String rest = line.substring(1); | |
if (line.charAt(0) == c) | |
{ | |
return count(rest, c) + 1; | |
} | |
else | |
{ | |
return count(rest, c); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dada una cadena de caracteres de longitud N, determinar cuál es la vocal que aparece más veces.