- 310 名前:デフォルトの名無しさん [2013/02/24(日) 19:55:26.36 ]
- 続き
int hash(int key){ return(key%13);} int rehash(int key){ return((key+1)%13);} void SetBucket(Bucket *n,Data x,Status stat){ n->data=x; n->stat=stat;} int InitHash(Hash *h,int size){ int i; h->size=0; if((h->table=calloc(size,sizeof(Bucket)))==NULL){ return 0; } h->size=size; for(i=0;i<size;i++){ h->table[i].stat=Empty; } return 1;} void TermHash(Hash *h){ free(h->table);}
|

|