Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Buscar(Arbol a, int dat)
- {
- pNodo actual = a;
- while(!Vacio(actual))
- {
- if(dat == actual->dato)
- {
- return 1; /* dato encontrado (2) */
- }
- else if(dat < actual->dato)
- {
- actual = actual->izquierdo; /* (3) */
- }
- else if(dat > actual->dato)
- {
- actual = actual->derecho; /* (4) */
- }
- }
- return 0; /* No está en árbol (1) */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement