Created
November 17, 2020 08:12
-
-
Save ochilab/fdf70b86f5f3e6eff81397ba07398aea to your computer and use it in GitHub Desktop.
ハッシュテーブルにおけるオープンアドレス法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bucket *SearchOpenBucket(Hash *h, Data x){ | |
int i; | |
int key = hash(x.no); /* 探索するデータのハッシュ値 */ | |
Bucket *p = &h->table[key]; /* 着目ノード */ | |
for (i = 0; p->stat != Empty && i < h->size; i++) { | |
if (p->stat == Occupied && p->data.no == x.no) | |
return (p); | |
key = rehash(key); | |
p = &h->table[key]; | |
} | |
return (NULL); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment