Skip to content

Instantly share code, notes, and snippets.

@heanfig
Created March 2, 2017 03:40
Show Gist options
  • Save heanfig/a93226095c172d4b7ea7b8d0815ad2c7 to your computer and use it in GitHub Desktop.
Save heanfig/a93226095c172d4b7ea7b8d0815ad2c7 to your computer and use it in GitHub Desktop.
RecursiveIteration
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);
}
}
@heanfig
Copy link
Author

heanfig commented Mar 2, 2017

Dada una cadena de caracteres de longitud N, determinar cuál es la vocal que aparece más veces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment