Difference between revisions of "QuickSort"

From SCAR Divi Manual
Jump to: navigation, search
Line 5: Line 5:
  
 
==Availability==
 
==Availability==
SCAR Divi 3.14 > Current
+
SCAR Divi 3.14 > Current <span style="color:#FF0000">(Deprecated, use [[SortTIA]])</span>
  
 
* '''Values''' was a [[TIntegerArray]] before SCAR Divi 3.28.
 
* '''Values''' was a [[TIntegerArray]] before SCAR Divi 3.28.
Line 36: Line 36:
 
*[[BubbleSortB]]
 
*[[BubbleSortB]]
  
[[Category:Functions]]
+
[[Category:Deprecated Functions]]
[[Category:Math Functions]]
 

Revision as of 18:50, 24 October 2011

Definition

procedure QuickSort(var Values: TIntArray);

Availability

SCAR Divi 3.14 > Current (Deprecated, use SortTIA)

Description

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

Example

var
  Values: TIntArray;
  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