0001 template <typename K, typename V> Hashtable<K, V>::~Hashtable() { //析构前释放桶数组及非空词条 0002 for ( Rank i = 0; i < M; i++ ) //逐一检查各桶 0003 if ( ht[i] ) delete ht[i]; //释放非空的桶 0004 delete ht; //释放桶数组 0005 delete removed; //释放懒惰删除标记 0006 }