private void resize(double factor) {
	if (buckets.length * factor < size) {
	    return;
	}
	DLinkedList[] temp = new DLinkedList[(int)(buckets.length * factor)];
	this.numBuckets = temp.length;
	int s = this.size, index;
	DLinkedListNode node;
	Entry entry;
      
	for (int i = 0; i < buckets.length; i++) {
	    if (buckets[i] != null && !(buckets[i].isEmpty())) {
		node = (DLinkedListNode)(buckets[i].front());
		try {
		    while (node.isValidNode()) {
			entry = (Entry)(node.item());
			index = compFunction(entry.key.hashCode());
			if (temp[index] == null) {
			    temp[index] = new DLinkedList();
			}
			temp[index].insertBack(entry);
			s--;
			node = (DLinkedListNode)(node.next());
		    }
		}
		catch(Exception ex) {
		    System.out.println(ex);
		}
	    }
	    if (s == 0) { break; }
	}
	buckets = temp;
    }