对关键字序列 {44,36,23,35,52,73,90,58} 建立哈希表,哈希函数为 h(k)=k%7,执行下面的 Insert 函数,则等概率情况下的平均成功查找长度(即查找成功时的关键字比较次数的均值)为( )。

vq983977 单选题 共 个子题
#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;
}
A

7/8

B

1

C

1.5

D

2

正在加载题目数据…
已答 /
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析
讨论
发布
登录后参与讨论 立即登录
发布讨论需先绑定并验证手机号 去绑定手机号
加载中…
我
我
回复 @
回复 @
发送
还没有人讨论,来发表第一条吧