LongestOrderedSequence

LongestOrderedSequence[list]

finds the longest ordered sequence of contiguous or disjoint elements in list.

LongestOrderedSequence[list,p]

finds the longest ordered sequence using the ordering function p.

Details and Options

Examples

open allclose all

Basic Examples  (4)

Find the longest ordered substring, in this case formed by contiguous characters:

In[1]:=
Click for copyable input
Out[1]=

Find the longest ordered sequence of elements in a list:

In[1]:=
Click for copyable input
Out[1]=

Find the longest strictly ordered sequence of elements in a list:

In[1]:=
Click for copyable input
Out[1]=

Find the longest decreasing sequence of elements in a list:

In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

Options  (1)

Applications  (1)

Neat Examples  (1)

See Also

SequenceCases  Sort  OrderedQ  Longest  LongestCommonSequence  LongestCommonSubsequence

Introduced in 2015
(10.2)