Guest User

Untitled

a guest
Jun 13th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public int buscarIndice(String nome) {
  2.  
  3. int i = hashCode(nome);
  4. while(!alunos[i].nome.equals(nome)){
  5. int soma = calcularValor(nome);
  6. i = doubleHash(soma, i);
  7. }
  8. return i;
  9. }
  10.  
  11. public void inserir(String nome,int nota){
  12.  
  13. int i = hashCode(nome);
  14.  
  15. while(alunos[i] != null){
  16. alunos[i].colisoes++;
  17. int k = calcularValor(nome);
  18. i = doubleHash(k, i);
  19.  
  20. }
  21. alunos[i] = new Aluno(nome,nota);
  22. }
Add Comment
Please, Sign In to add comment