Selection Sort - delphi

procedure  SelectionSort(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
       
        T := A[I];
        A[I] := A[J];
        A[J] := T;
      
      end;
end;


//=================================
// see as:

Bubble Sort - delphi

Quick Sort -delphi

 

沒有留言:

張貼留言