Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 19, 2022 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/11b6132f1758295f81f7a207b1fc098f to your computer and use it in GitHub Desktop.
Save parzibyte/11b6132f1758295f81f7a207b1fc098f to your computer and use it in GitHub Desktop.
public static Arbol obtenerArbol() {
String palabra = AyudanteDatos.solicitarPalabra();
Arbol arbol = new Arbol();
for (int i = 0; i < palabra.length(); i++) {
String letra = String.valueOf(palabra.charAt(i));
if (!arbol.existe(letra)) {
arbol.insertar(letra);
}
}
return arbol;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment