Schensted insertion algorithm
Tags: #definition
Schensted insertion algorithm
Suppose we have the permutation
The shape of the resulting tableaux is called the Schensted shape of a permutation.
Properties
- If we construct
, then the inverse permutation
Algorithm
To construct
- For each
- If
is larger than all the entries in the first row, add a new box at the end of the row and label it - Otherwise, replace the smallest entry larger than
(let's call it ) with . - Repeat this process with
for the next row

- If
To construct
- It has the same shape as
and you label each box with the order in which that box was created when you were performing the algorithm on .

Now we need to give an inverse with this algorithm:
- Find the max entry in
- Find the corresponding entry in
, say - Iterate until you reach the first row:
- Look for the max entry in the previous row (above) that is less than
- Set this to be the new
- Look for the max entry in the previous row (above) that is less than
- When you reach the first row, the number that you pick is the last element of the permutation.