function for Cuckoo-hashing keys * keys[]: input array of keys * n: size of input array */
| 98 | * keys[]: input array of keys |
| 99 | * n: size of input array */ |
| 100 | void cuckoo(int keys[], int n) |
| 101 | { |
| 102 | // initialize hash tables to a dummy value (INT-MIN) |
| 103 | // indicating empty position |
| 104 | initTable(); |
| 105 | |
| 106 | // start with placing every key at its position in |
| 107 | // the first hash table according to first hash |
| 108 | // function |
| 109 | for (int i=0, cnt=0; i<n; i++, cnt=0) |
| 110 | place(keys[i], 0, cnt, n); |
| 111 | |
| 112 | //print the final hash tables |
| 113 | printTable(); |
| 114 | } |
| 115 | |
| 116 | /* driver function */ |
| 117 | int main() |
no test coverage detected