C++散列表二次探测

2015-11-21 01:02:23 · 作者: · 浏览: 5
#include 
   
     #include 
    
      using namespace std; enum KindOfStatus { Empty=0, Avtive, Deleted, }; template
     
       class HashTable { public: HashTable(int sz) { data = new Type[sz]; ofs = new KindOfStatus[sz]; for(int i=0;i
      
       =DefaultSize) break; k++; } if(2*k+1>
=DefaultSize)//说明空间已经满了,在这里重新开辟一倍的空间. { int savedata[DefaultSize]; int saveofs[DefaultSize]; int i=0; for(;i ht(3); int a[]={1,4,7,10}; ht.Insert(a,4); ht.Show(); return 0; }