84 std::cout <<
"data[" << index <<
"]:";
86 while (pointer != NULL) {
88 std::cout <<
"data[" << pointer->key <<
"]:";
89 if (pointer->key ==
key)
92 pointer = pointer->next;
101 int key, index, i, counter;
105 while (index <
MAX) {
110 for (i = 0; i <
HASHMAX; i++) {
111 std::cout <<
"hashtab [" << i <<
"]\n";
116 std::cout <<
"please int key:";
118 std::cout <<
"[" << p->key <<
"]";
121 std::cout << std::endl;
129 std::cout <<
"search time = " << counter << std::endl;
131 std::cout <<
"no found!\n";
int hash_search(int key, int *counter)
#define MAX
Determines how much data.
#define HASHMAX
Determines the length of the hash table.
void create_list(int key)
struct list * link
pointer to nodes
node hashtab[HASHMAX]
array of nodes
struct list * next
pointer to next link in the chain
int key
key value for node