Skip to content

OrderedQ

OrderedQ({a, b,...})

is True if a sorts before b according to canonical ordering for all adjacent elements.

OrderedQ({a, b,...}, comparator)

is True if a sorts before b according to the comparator functions value for all adjacent elements. If the comparator function returns False or -1 the OrderedQ function returns False. If the comparator function doesn’t return False or -1 for all adjacent elements the OrderedQ function returns True.

See

Examples

>> OrderedQ({a, b})
True
>> OrderedQ({b, a})
False

Implementation status

  • ✅ - full supported

Github