Pengurutan Dengan menggunakan Selection Sort
var
i,j,n,maks,temp:integer;
L:Array [1..100] of integer;
begin
for <- n downto 2 do
maks<-1;
for j<-2 to i do
if L[j]>L[maks] then
maks <-j;
end if
end for
temp<-L[i];
L[i]<-L[maks];
L[maks]<-temp;
end for
end.
0 Comment:
Posting Komentar