To C++ Experts,

I am still struggling to understand the logic of a hashtable. This is a continued question of :

http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20817844.html
The implementation of the insert() function looks like :

--------------------------

-------------------------------------------

template <class K, class T, class H>

bool HashTable<K,T,H>::insert(K key, T val)

{ const K ZERO_K = K() ;

int k0 = hash(key), k = k0 ; // line01 .... Q1

while ( _[k].first != key && _[k].first != ZERO_K)

k=(k+1)%_.size() ;

if (_[k].first == key) return false ;

if (size()+1 < LOAD*_.size()) _[k] = Pair(key,val) ;

else

{ rebuild() ;

insert(key,val) ;

}

return true ;

}

------------------------------------------------------

So here is my question :

Q1. in line01: k0 and k could be values larger than 1, and "_" is a vector of pair in the HashTable. Then it seems to me that : the vector "_" does not start from 0 ? (I mean _[0], v[1] ... could be empty). It starts at certain k dependes on the pair we inserted and the first several elements of "_" could be empty ???

Q2. if the above statement is true, it troubles me a lot ! If the first several elements of "_" is empty, what does _.size() mean ? Then how do we know the later implementation such as "size()+1 < LOAD*_.size()" is correct ?

Thanks very much !!!

meow.