第22616题 单选题
对关键字序列{44,36,23,35,52,73,90,58}按指定规则建立哈希表,求等概率平均成功查找长度

哈希函数为 h(k)=k%7,插入逻辑由以下C++代码实现:

#include <iostream>
#include <string>
#include <cmath>
#include <vector>
using namespace std;

typedef struct Node{
    int data;
    struct Node *next;
}Node;
Node* hTab[7];
int key[]={44, 36, 23, 35, 52, 73, 90, 58, 0};
void Insert()
{
    int i,j;
    Node *x;

    for(i=0; key[i];i++){
        j = key[i] % 7;
        x=new Node;
        x->data = key[i];
        x->next = hTab[j];
        hTab[j] = x;
    }
    return;
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析