DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


SortElems

Declaration:TVector.SortElems (Ascending: boolean; RangeFirst, RangeLast: integer);
The method SortElems provides a means to sort the elements of a vector or part of it. The vector is sorted within the range RangeFirst and RangeLast. The values outside this range are not affected. If both RangeFirst and RangeLast are set to zero values the entire vector is sorted. The parameter Ascending specifies whether the valus are to be sorted in ascending (TRUE) or descending (FALSE) order.

The sorting is performed by a modified bubble sort (CombSort), which has been reported to be comparable in speed to QuickSort (see also R.Box, S. Lacey, BYTE magazine, April 1991).