Thema: Delphi zu blöd für MinSort...

Einzelnen Beitrag anzeigen

Illuminator-23-5
(Gast)

n/a Beiträge
 
#4

Re: zu blöd für MinSort...

  Alt 3. Dez 2003, 18:27
Zitat:
if a[j] < a[i] Then pos := j;
if a[j] < a[pos] then pos := j;

dann müssts gehn:
Delphi-Quellcode:
for i:= 1 to anz do begin
  pos:=i;
  for j:= i+1 to anz do begin
   if a[j]<a[pos] then pos:=j;
   hilf:=a[pos];
   a[pos]:= a[i];
   a[i]:=hilf;
  end;
end;
  Mit Zitat antworten Zitat