zadefinovany je takto:
Kód: Vybrať všetko
type ukazovatel=^zaznam;
zaznam=record
predchadzajuci:ukazovatel;
hodnota:integer;
dalsi:ukazovatel;
end; Kód: Vybrať všetko
procedure Utried;
var p,q:ukazovatel;
x:integer;
begin
if start=nil then writeln('Nie je co triedit')
else if start^.dalsi=start then writeln('zoznam je jednoprvkovy')
else begin
p:=start;
repeat
q:=start^.predchadzajuci;
repeat
if q^.hodnota<q^.predchadzajuci^.hodnota then begin
x:=q^.hodnota;
q^.hodnota:=q^.predchadzajuci^.hodnota;
q^.predchadzajuci^.hodnota:=x;
end;
q:=q^.predchadzajuci;
until q^.predchadzajuci=p;
p:=p^.dalsi;
until p=start^.predchadzajuci;
end;
end; daco vymeni, ale zle, nechapem preco. vedel by niekto pomoct?