Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //metodo da prova
- public boolean pesquisa(Comparable elemento)
- {
- Pilha p = new …
- p.empilha(raiz);
- while(!p.seVazia())
- {
- NoAB no = p.desempilha();
- if(no == null) continue;
- if(elemento.compareTo(no.pegaElemento()) == 0)
- return true;
- p.empilha(no.pegaEsq());
- p.empilha(no.pegaDir());
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement