Ver Mensaje Individual
  #19 (permalink)  
Antiguo 30/10/2017, 22:07
Avatar de detective_jd
detective_jd
 
Fecha de Ingreso: abril-2011
Ubicación: Salto
Mensajes: 437
Antigüedad: 13 años
Puntos: 6
Respuesta: TablaHash y sus pasos

Buenas a todos, al final solucioné el problema que tenía resulta que tenía que cambiar el addEntry de MyMap y arreglarlo a esto:

Código Java:
Ver original
  1. private void addEntry(K key, V value){
  2.         if(size >= table.length * 0.75){
  3.             Entry<K,V>[] tmp = table;
  4.             table = Arrays.copyOf(table, table.length * 2);
  5.             this.clear();
  6.             for (Entry<K, V> e : tmp) {    
  7.                 if(e != null){
  8.                     put(e.getKey(),e.getValue());
  9.                 }
  10.             }            
  11.         }
  12.         this.createEntry(key,value);
  13.     }

También actualice mis repositorios en github:

https://github.com/detectivejd/HassMap_casero

https://github.com/detectivejd/HashSet_casero

https://github.com/detectivejd/LinkedHashMap_casero

Ahora veré si puedo completar el LinkedHashSet, si lo logro genial y lo pongo en este medio, si falta algún test o hay que hacerle alguna corrección por favor diganlo.

Espero sus respuestas y saludos.