Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

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 OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Find the longest ordered noncontiguous substring:

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

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

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

Find the longest strictly ordered noncontiguous 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]=
Introduced in 2015
(10.2)