@Override
	public V put(K key, V value) {
		int i = findEntry(key);
		if (i >= 0)// replace entries
			return ((HashEntry<K, V>) bucket[i]).setValue(value);
		// insert into new place
		else if (size >= capacity / 2) {// load factor>=0.5, need rehashing
			rehash();
			i = findEntry(key);
		}
		// -(i+1), easily find the available place and insert
		bucket[-i - 1] = new HashEntry<K, V>(key, value);
		size++;
		return null;
	}