Основы программирования. Динамические массивы. Списки. Ассоциативные массивы. Деревья. Хеш-таблицы - 26 стр.

UptoLike

Составители: 

28
cur:=cur.next
end;
procedure ListIterator.Prev;
begin
Assert(cur<>nil);
cur:=cur.prev
end;
function ListIterator.Eol: boolean;
begin
Result := cur=nil
end;
procedure ListIterator.MoveFirst;
begin
cur:=L.f;
end;
procedure ListIterator.MoveLast;
begin
cur:=L.l;
end;
procedure ListIterator.InsertBefore(x: DataType);
var v: PNode;
begin
Assert(cur<>nil);
if cur=L.f then
L.AddFirst(x)
else
begin
v:=NewNode(x,cur.prev,cur);
cur.prev.next:=v;
cur.prev:=v;
end
end;
procedure ListIterator.InsertAfter(x: DataType);
var v: PNode;
begin
Assert(cur<>nil);
if cur=L.l then
L.AddLast(x)
else
begin
v:=NewNode(x,cur,cur.next);