All pastes #253617 Raw Edit

Anonymous

public text v1 · immutable
#253617 ·published 2006-11-20 23:04 UTC
rendered paste body
// ========================================================================== //
// Odwracanie listy:
procedure Reverse(var L1 : Lista);
var
 temp, copy, last : T_lista;
begin
 copy := L1.First;
 while (copy.next <> nil) do
  copy := copy.next;

 last := copy;

 while (L1.First.next <> nil) do
 begin
  temp := L1.First;
  while (temp.next.next <> nil) do
  begin
   temp := temp.next;
  end;
  last.next := temp;
  last := last.next;
  temp.next := nil;
 end;

 L1.First := copy;
end;