- 3


, - . , . , , .

procedure include_in_list (r: rec);

var next,curr: plist; prev: ^plist;

begin

next := po; { }

prev := @p0; {c }

while (next<>Nil) and (order (r, next^.d) >= 0) do begin

prev := @(next.p); {c }

next := next.p { }

end; {C }

new (curr); { }

curr^.d := r; { }

curr^.p := prev^; { }

prev^ := curr; { }

end;

, , ( ). . .


function exclude_from_list (r: rec): boolean;

var next: plist; prev: ^plist;

begin

exclude_from_list := false;

next := po; { }

prev := @p0; {c }

while (next<>Nil) and (order (r, next^.d) <= 0) do

if order (r, next^.d) = 0 { }

then begin prev^ := next.p; { }

dispose (next); { }

exclude_from_list := true; { }




- -  - -  - -