コード例 #1
0
ファイル: t1lp.c プロジェクト: gnsantos/hashing
Item ST1search(Key v)
{ int i = hash(v, M);
  int t = n_probes;
  while (!onull(i))
    if (eq(v, key(st[i]))) {
      n_probes_hit+=n_probes-t;
      return st[i];
    } else i = (i+1) % M;
  n_probes_miss+=n_probes-t;
  return NULLitem;
}
コード例 #2
0
ファイル: t2lp.c プロジェクト: ruan0408/EP4-ED
/*Procura chave na tabela*/
Item_lema st_lema_search(Key_lema v)
{
    int i = hash(v, M);
    int t = n_probes;
    while (!onull(i))
        if (eq_lema(v, key_lema(st_lema[i])))
        {
            n_probes_hit+=n_probes-t;
            return st_lema[i];
        }
        else i = (i+1) % M;
    n_probes_miss+=n_probes-t;
    return NULLitem_lema;
}