Advertisement
HeNrYTG50

"buscar" incompleto

Nov 24th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. Nodo<Tipo> *actual;
  2. bool encontro = false;
  3. bool izq = true, der = true;
  4. if (raiz == NULL)
  5. {
  6. cout << "El arbol esta vacio" << endl << endl;
  7. return false;
  8. }
  9. else
  10. {
  11. actual = raiz;
  12. while (actual != NULL && !encontro)
  13. {
  14. if (actual->informacion() == Padre)
  15. encontro = true;
  16. else
  17. {
  18. if (actual->informacion() > Padre)
  19. actual = actual->ligaizquierda();
  20. else
  21. actual = actual->ligaderecha();
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement