private void btnBuscar_Click(object sender, EventArgs e) { miNodo = miArbol.buscar(Convert.ToInt32(txtDato.Text)); if (miNodo == null) { txtMostrar.Text = "No encontrado"; } else { txtMostrar.Text = miNodo.ToString(); } }
private string PreOrder(Nodo nodo) { string res = ""; res += nodo.ToString(); if (nodo.hIzq != null) { res += PreOrder(nodo.hIzq); } if (nodo.hDer != null) { res += PreOrder(nodo.hDer); } return(res); }