提交 5828125b 创建 作者: 宋海霞's avatar 宋海霞

modify

上级 ae823ec0
#ifndef SEARCHHASH_H_ #ifndef SEARCHHASH_H_
#define SEARCHHASH_H_ #define SEARCHHASH_H_
// //
// Include the C standard library header file here // Include the C standard library header file here
// //
#include <stdio.h> #include <stdio.h>
// //
// Other header files are included here // Other header files are included here
// //
#include <stdlib.h> #include <stdlib.h>
// //
// Define the data structure here // Define the data structure here
// //
#define HASH_LEN 20 // The length of the hash table #define HASH_LEN 20 // The length of the hash table
// Hash table // Hash table
typedef struct hterm{ typedef struct hterm
{
int key; // keyword int key; // keyword
int si; // The number of rehashes int si; // The number of rehashes
}HASH; }HASH;
// //
// Declare the function here // Declare the function here
// //
void Hash(int* KeyArray, int length); // The hash function void Hash(int* KeyArray, int length); // The hash function
// //
// Declare global variables here // Declare global variables here
// //
extern HASH HashList[HASH_LEN]; extern HASH HashList[HASH_LEN];
extern int RandomArray[]; extern int RandomArray[];
extern int Arraylength; extern int Arraylength;
#endif /* CONSOLE_H_ */ #endif /* CONSOLE_H_ */
...@@ -21,7 +21,7 @@ int main(int argc, char* argv[]) ...@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
Hash(KeyArray, length); Hash(KeyArray, length);
printf("\nSubscript\tRehashesCount\tKeyword\t\n"); printf("\nSubscript\tRehashesCount\tKeyword\t\n");
for(i=0; i<HASH_LEN; i++) for (i=0; i<HASH_LEN; i++)
{ {
printf("%d", i); printf("%d", i);
printf("\t\t\t%d", HashList[i].si); printf("\t\t\t%d", HashList[i].si);
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论