Professional Documents
Culture Documents
Ordenación
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J If (vec[I] > max) then
I begin
H 0 max := vec[I];
pos := I;
MAX end;
POS end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I begin
H 0 max := vec[I];
pos := I;
MAX end;
POS end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I begin
H 0 max := vec[I];
pos := I;
MAX 15 end;
POS end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I begin
H 0 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I 2 begin
H 0 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
IF ( 0 > 15) H := 0;
FALSE For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I 2 begin
H 0 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I 3 begin
H 0 max := vec[I];
pos := I;
MAX 23 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I 3 begin
H 0 max := vec[I];
pos := I;
MAX 23 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
IF (9 > 23) H := 0;
FALSE For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I 5 begin
H 0 max := vec[I];
pos := I;
MAX 23 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I 4 begin
H 0 max := vec[I];
pos := I;
MAX 23 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I 4 begin
H 0 max := vec[I];
pos := I;
MAX 23 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 1 If (vec[I] > max) then
I 4 begin
H 1 max := vec[I];
pos := I;
MAX 23 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 2 If (vec[I] > max) then
I 4 begin
H 1 max := vec[I];
pos := I;
MAX 15 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 2 If (vec[I] > max) then
I 4 begin
H 1 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 2 If (vec[I] > max) then
I 2 begin
H 1 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
IF (0 > 15) H := 0;
FALSE For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 2 If (vec[I] > max) then
I 2 begin
H 1 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
IF (9 > 15) H := 0;
FALSE For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 2 If (vec[I] > max) then
I 3 begin
H 1 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 2 If (vec[I] > max) then
I 4 begin
H 1 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 2 If (vec[I] > max) then
I 4 begin
H 1 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 2 If (vec[I] > max) then
I 4 begin
H 2 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 4 begin
H 2 max := vec[I];
pos := I;
MAX 15 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 4 begin
H 2 max := vec[I];
pos := I;
MAX -5 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 4 begin
H 2 max := vec[I];
pos := I;
MAX -5 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 2 begin
H 2 max := vec[I];
pos := I;
MAX -5 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
IF (0 > -5) H := 0;
TRUE For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 2 begin
H 2 max := vec[I];
pos := I;
MAX -5 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 2 begin
H 2 max := vec[I];
pos := I;
MAX 0 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 2 begin
H 2 max := vec[I];
pos := I;
MAX 0 end;
POS 2 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
IF (9 > 0) H := 0;
TRUE For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 3 begin
H 2 max := vec[I];
pos := I;
MAX 0 end;
POS 2 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 3 begin
H 2 max := vec[I];
pos := I;
MAX 9 end;
POS 2 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 3 begin
H 2 max := vec[I];
pos := I;
MAX 9 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 3 begin
H 2 max := vec[I];
pos := I;
MAX 9 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 3 begin
H 2 max := vec[I];
pos := I;
MAX 9 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 3 If (vec[I] > max) then
I 3 begin
H 3 max := vec[I];
pos := I;
MAX 9 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 3 begin
H 3 max := vec[I];
pos := I;
MAX 9 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 3 begin
H 3 max := vec[I];
pos := I;
MAX -5 end;
POS 3 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 3 begin
H 3 max := vec[I];
pos := I;
MAX -5 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 2 begin
H 3 max := vec[I];
pos := I;
MAX -5 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
IF (0 > -5) H := 0;
TRUE For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 2 begin
H 3 max := vec[I];
pos := I;
MAX -5 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 2 begin
H 3 max := vec[I];
pos := I;
MAX 0 end;
POS 1 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 2 begin
H 3 max := vec[I];
pos := I;
MAX 0 end;
POS 2 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 2 begin
H 3 max := vec[I];
pos := I;
MAX 0 end;
POS 2 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 2 begin
H 3 max := vec[I];
pos := I;
MAX 0 end;
POS 2 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 4 If (vec[I] > max) then
I 2 begin
H 4 max := vec[I];
pos := I;
MAX 0 end;
POS 2 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
H := 0;
For J := 1 to N – 1 do
begin
max := vec[1];
pos := 1;
Variables For I := 2 to N – H do
begin
J 5 If (vec[I] > max) then
I 2 begin
H 4 max := vec[I];
pos := I;
MAX 0 end;
POS 2 end;
N 5 vec[pos] := vec[N – H];
vec[N – H] := max;
H := H + 1;
end;
Valor -5 0 9 15 23
Posición 1 2 3 4 5
begin
for I := 1 to N - 1 do
begin
for J := 1 to N - I do
If (vec[J] > vec[J+1]) then
begin
aux := vec[J];
vec[J] := vec[J+1];
vec[J+1] := aux
end;
end;
end;
Valor 15 0 23 -5 9
Posición 1 2 3 4 5
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J vec[J+1] := aux
AUX end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 3 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 3 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 3 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 4 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 4 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 1 vec[J] := vec[J+1];
J 4 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 2 vec[J] := vec[J+1];
J 4 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 2 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 2 vec[J] := vec[J+1];
J 2 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 2 vec[J] := vec[J+1];
J 2 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 2 vec[J] := vec[J+1];
J 2 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 2 vec[J] := vec[J+1];
J 3 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 2 vec[J] := vec[J+1];
J 3 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 2 vec[J] := vec[J+1];
J 3 vec[J+1] := aux
AUX 15 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 3 vec[J] := vec[J+1];
J 3 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 3 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 3 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 0 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 3 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 0 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 3 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 0 end;
end;
N 5 end;
IF (0 > 9) For I := 1 to N – 1 do
FALSE begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 3 vec[J] := vec[J+1];
J 2 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 4 vec[J] := vec[J+1];
J 2 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 4 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
For I := 1 to N – 1 do
begin
For J := 1 to N – I do
begin
If (vec[J] > vec[J+1]) then
Variables begin
aux := vec[J];
I 4 vec[J] := vec[J+1];
J 1 vec[J+1] := aux
AUX 23 end;
end;
N 5 end;
Valor -5 0 9 15 23
Posición 1 2 3 4 5