SortATIABySize

From SCAR Divi Manual
Jump to: navigation, search

Definition

procedure SortATIABySize(var ATIA: T2DIntArray);

Availability

SCAR Divi 3.28 > Current

Description

Sorts the TIntArrays in the given T2DIntArray ATIA by their respective lengths using the fast ShellSort algorithm.

Example

var
  ATIA: T2DIntArray;
  i: Integer;

begin
  SetLength(ATIA, 3);
  ATIA[0] := [1, 5, 6, 7];
  ATIA[1] := [2, 4];
  ATIA[2] := [7, 8, 4, 5, 6];
  SortATIABySize(ATIA);
  for i := 0 to High(ATIA) do
    WriteLn(TIAToStr(ATIA[i]));
end.

Output:

2,4
1,5,6,7
7,8,4,5,6