Metoda Selectiei 1
for i:=1 to n-1 do
for j:=1 to n do
if a[i]<a[j] then
begin
aux:=a[i];
a[i]:=a[j];
a[j]:=aux;
end;
Metoda Selectiei 2
for i:=1 to n-1 do
for j:=1 to n-i do
if a[j]<a[j+1] then
begin
aux:=a[j];
a[j]:=a[j+1];
a[j+1]:=aux;
end;
Metoda Bulelor
REPEAT
gasit:=false;
for i:=1 to n-1 do
if a[i]<a[i+1] then
begin
aux:=a[i];
a[i]:=a[i+1];
a[i+1]:=aux;
gasit:=true;
end;
UNTIL not gasit;