ВУЗ:
Составители:
Рубрика:
20
if l.prev<>nil then
l.prev.next:=l;
if f=nil then
f:=l;
end;
procedure List.DeleteFirst;
var v: PNode;
begin
Assert(not IsEmpty);
v:=f;
f:=f.next;
if cur=v then
cur:=f;
Dispose(v);
if f<>nil then
f.prev:=nil
else l:=nil;
end;
procedure List.DeleteLast;
var v: PNode;
begin
Assert(not IsEmpty);
v:=l;
l:=l.prev;
if cur=v then
cur:=l;
Dispose(v);
if l<>nil then
l.next:=nil
else f:=nil
end;
function List.IsEmpty: boolean;
begin
Result:= f=nil;
end;
// Вспомогательные
методы
function List.First: DataType;
begin
Assert(not IsEmpty);
Result:=f.data;
end;
Страницы
- « первая
- ‹ предыдущая
- …
- 16
- 17
- 18
- 19
- 20
- …
- следующая ›
- последняя »