Kod: Zaznacz cały
type lista : ^element;
type element : record
pole : integer;
next : lista
end;
Kod: Zaznacz cały
procedure usun (h,v:lista);
var u:lista;
begin
while h<>nil do
begin
if h^.pole<>h^.next^.pole then
h:=h^.next
else
begin
if v=nil then
begin
u:=h^.next;
h^.next:=u^.next;
dispose(u);
end
else
begin
u:=h^next;
h^.next:=u^.next;
v^.next:=h;
v:=v^.next;
dispode(u);
end;
end;
end;
v^.next:=nil;
end.