QuickSort

From SCAR Divi Manual
Revision as of 23:26, 1 July 2011 by Freddy (talk | contribs)
Jump to: navigation, search

Definition

procedure QuickSort(var Values: TIntegerArray);

Availability

SCAR Divi 3.14 > Current

Description

Uses the quicksort sorting algorithm to sort a given set of integer values specified by the TIntegerArray Values. The values will be sorted small->large.

Example

var
  Values: TIntegerArray;
  i: Integer;
begin
  Values := [9, 1, 8, 2, 4];
  QuickSort(Values);
  for i := Low(Values) to High(Values) do
    WriteLn(Values[i]);
end.

Output:

1
2
4
8
9

See Also