????
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>#define KEYLENGTH 15//长度超过15的单词将只截取保留前15个单词字符
#define MAXTABLESIZE 111111//允许开辟的最大散列表长度
#define MAXWORDLEN 80 //单词输入的最大长度
typedef char ElementType[KEYLENGTH+1];//链表的数据域是一个字符串
typedef int Index;//散列地址类型 typedef struct LNode *PtrToLNode;//单链表一个结点的定义
struct LNode{ElementType Data;//结点的数据域是一个字符串 int Count;//存储该单词的出现次数,空头结点的Count用来存储该单链表的结点数 PtrToLNode Next;
};
typedef PtrToLNode Position;
typedef PtrToLNode List;typedef struct TblNode *HashTable;
struct TblNode{//散列表结点的定义 int TableSize;List Heads;
};int NextPrime(int n)//返回大于n且不超过MAXTABLESIZE的最小素数
{int i,p;for(p=n+1;p<MAXTABLESIZE;p++){for(i=2; i<=p; i++){if(p%i== 0) break;}if(i>=p) return p;}
}HashTable CreateTable(int TableSize)
{HashTable H;int i;H = (HashTable)malloc(sizeof(struct TblNode));H->TableSize =NextPrime(TableSize);//保证散列表最大长度是素数H->Heads =(List)malloc(H->TableSize *sizeof(struct LNode));for(i=0; i<H->TableSize ;i++){//初始链表头结点 H->Heads[i].Data[0] = '