ВУЗ:
Составители:
Рубрика:
- 19 -
then HashAdd := false
else
begin
i := HashKey( Info.Phone );
while
HTable.H[i].used do i := (i+1) mod HTableLen;
HTable.H[i].used := true;
HTable.H[i].Info := Info;
HTable.Size := HTable.Size + 1
end
end
;
-
procedure
HashPrint( var HTable: THashTable );
var
i: Integer;
begin
-
for
i:=0 to HTableLen-1 do
with
HTable.H[i] do
if
used then
WriteLn(i:3,': ',Info.Phone, ' ', Info.FIO)
end
;
end
.
Ijbf_jijh]jZffujZ[hlukowr-lZ[ebp_c
program
HashTest;
uses
Hash;
var
-
-
procedure
Input;
begin
if
HashAdd( H, Info )
then
- )
else
-
end
;
begin
HashInit( H );
-
- 19 - then HashAdd := false else begin i := HashKey( Info.Phone ); while HTable.H[i].used do i := (i+1) mod HTableLen; HTable.H[i].used := true; HTable.H[i].Info := Info; HTable.Size := HTable.Size + 1 end end; ^ I_qZlv aZiheg_gguo yq__d owr-lZ[ebpu ` procedure HashPrint( var HTable: THashTable ); var i: Integer; begin :ULWH/Q Kh^_j`bfh_ owr-lZ[ebpu :ULWH/Q 11! L_e_nhg! NZfbeby Bfy Hlq_kl\h! for i:=0 to HTableLen-1 do with HTable.H[i] do if used then WriteLn(i:3,': ',Info.Phone, ' ', Info.FIO) end; end. Ijbf_jijh]jZffujZ[hlukowr-lZ[ebp_c program HashTest; uses Hash; var + 7+DVK7DEOH ^ owr-lZ[ebpZ ` ,QIR 7,QIR ^ BgnhjfZpby h[ Z[hg_gl_ ` 3KRQH 73KRQH ^ L_e_nhgguc ghf_j Z[hg_glZ ` ^ <\h^ ^Zgguo \ owr-lZ[ebpm k hlh[jZ`_gb_f j_amevlZlZ hi_jZpbb ` procedure Input; begin if HashAdd( H, Info ) then :ULWH/Q AZibkv \ owr-lZ[ebpm ijhreZ mki_rgh ) else :ULWH/Q Hi_jZpby aZibkb \ owr-lZ[ebpm hldehg_gZ end; begin :ULWH/Q BgbpbZebaZpby ! HashInit( H ); :ULWH/Q <\h^ bgnhjfZpbb \ owr-lZ[ebpm !
Страницы
- « первая
- ‹ предыдущая
- …
- 17
- 18
- 19
- 20
- 21
- …
- следующая ›
- последняя »