This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

OrderedQ

OrderedQ
gives True if the are in canonical order, and False otherwise.
  • By default, OrderedQ uses canonical order as described in the notes for Sort.
  • OrderedQ uses the function p to determine whether each pair of elements in list is in order.
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
OrderedQ works with any expressions:
OrderedQ works with any head, not just List:
Use Greater to test for ordering:
Find tuples that are in order:
Find which tuples are in order:
Sort by default sorts using OrderedQ:
OrderedQ by default works structurally, not by numerical value:
New in 1