Witam! Bardzo proszę o pomoc w sprawie co jest nie tak w tym algorytmie(jest to algorytm sortowania przez selekcję), ponieważ źle on sortuje. Czy jak numeruje
tablicę od 1 a ni od 0 to jest to w porządku?
program select_sort1;
var
n,i,k,index,max,l,m,temp : integer;
a : array[1..10] of integer;
begin
n:=10;
for k:=n downto 1 do
begin
max:=a[1];
for i:=0 to k do
if max<a[i] then
begin
max:=a[i];
index:=i;
end;
temp:=a[k];
a[k]:=max;
a[index]:=temp;
end;
end.