procedure insert( key : typekey; var r : dataarray );
var i, inc : integer;
begin
i := hashfunction( key );
inc := 0;
while (inckey) do begin
i := (i+inc+1) mod m;
inc := inc + 2;
end;
if empty(r[i]) or deleted(r[i]) then
begin
{*** insert here ***}
r[i].k := key;
n := n+1
end
else Error {*** table full, or key already in table ***};
end;
|