The OpenD Programming Language

SortedRangeOptions

Options for SortedRange ranges (below).

Values

ValueMeaning
assumeSorted

Assume, that the range is sorted without checking.

checkStrictly

All elements of the range are checked to be sorted. The check is performed in O(n) time.

checkRoughly

Some elements of the range are checked to be sorted. For ranges with random order, this will almost surely detect, that it is not sorted. For almost sorted ranges it's more likely to fail. The checked elements are choosen in a deterministic manner, which makes this check reproducable. The check is performed in O(log(n)) time.

Examples

// create a SortedRange, that's checked strictly
SortedRange!(int[],"a < b", SortedRangeOptions.checkStrictly)([ 1, 3, 5, 7, 9 ]);

Meta