Function Repository Resource:

# DescendingSublists

Split a list at its left-to-right maxima

Contributed by: George Beck
 ResourceFunction["DescendingSublists"][list] makes sublists of list starting at its left-to-right maxima.

## Details and Options

The elements in the sublists are in the same order as the original list.
A left-to-right maximum is greater than any preceding element.
The first element of each sublist is its maximum.
The first elements of the sublists are increasing.

## Examples

### Basic Examples (2)

Split a permutation given as a list into sublists starting at its left-to-right maximum:

 In[1]:=
 Out[1]=

The input does not have to be a permutation:

 In[2]:=
 Out[2]=
 In[3]:=
 Out[3]=

Flatten to get back the original list:

 In[4]:=
 Out[4]=

### Scope (4)

Here is a larger example:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

Each sublist starts from its maximum:

 In[7]:=
 Out[7]=

The first elements are increasing:

 In[8]:=
 Out[8]=

The sublists of s1 an be thought of as cycle notation for the permutation, but with a different canonical form than the Wolfram Language default, where each sublist starts with its minimum:

 In[9]:=
 Out[9]=

George Beck

## Version History

• 1.0.0 – 31 May 2019