Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public boolean buscar(int valor) {
  2. int pos = funcionHash(valor);
  3. NodoLista inicio = tabla[pos];
  4.  
  5. if (inicio == null) {
  6. System.out.println("Elemento no encontrado");
  7. return false;
  8. }else if(inicio.data == valor) {
  9. tabla[pos] = inicio.siguiente;
  10. System.out.println("Elemento encontrado");
  11. return true;
  12. }else{
  13. System.out.println("Elemento no encontrado");
  14. }
  15. return false;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement