. , , , .

 

 

-

q - ,

s - , q

 

:

 

:

s=nil

q=nil

p=table

while (p <> nil) do

if key = k(p) then

,

if q = nil then

search=p

return

endif

nxt(q)=nxt(p)

nxt(p)=q

if s = nil then

table = p

else nxt(s)=p

endif

search=p

return

endif

endwhile

search=nil

return

:

s:=nil;

q:=nil;

p:=table;

while (p <> nil) do

begin

if key = p^.k then

,

begin

if q = nil then

begin

-

search:=p;

exit;

end;

q^.nxt:=p^.nxt;

p^.nxt:=q;

if s = nil then

table := p;

else

begin

s^.nxt := p;

end;

search:=p;

exit;

end;

end;

search:=nil;

exit;

 

, ( ).

 




- -  - -  - -