Wikia

Delphi Programming

Selection sort

Talk0
2,909pages on
this wiki

Selection sort algorithm example from TThread demo of Delphi 5:

 procedure TSelectionSort.Sort(var A: array of Integer);
 var
   I, J, T: Integer;
 begin
   for I := Low(A) to High(A) - 1 do
     for J := High(A) downto I + 1 do
       if A[I] > A[J] then
       begin
         VisualSwap(A[I], A[J], I, J);
         T := A[I];
         A[I] := A[J];
         A[J] := T;
         if Terminated then Exit;
       end;
 end;
Code Snippets
DatabasesFiles and I/OForms/WindowsGraphicsNetworkingMath and AlgorithmsMiscellaneousMultimediaSystemVCL

Around Wikia's network

Random Wiki