Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 8, 2020 07:08
Embed
What would you like to do?
private void preorden(Nodo n) {
if (n != null) {
n.imprimirDato();
preorden(n.getIzquierda());
preorden(n.getDerecha());
}
}
private void inorden(Nodo n) {
if (n != null) {
inorden(n.getIzquierda());
n.imprimirDato();
inorden(n.getDerecha());
}
}
private void postorden(Nodo n) {
if (n != null) {
postorden(n.getIzquierda());
postorden(n.getDerecha());
n.imprimirDato();
}
}
public void preorden() {
this.preorden(this.raiz);
}
public void inorden() {
this.inorden(this.raiz);
}
public void postorden() {
this.postorden(this.raiz);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment