[Definition of Stirling permutation from Wikipedia:](https://en.wikipedia.org/wiki/Stirling_permutation)

> 
> In combinatorial mathematics, a Stirling permutation of order k is a permutation of the multiset $\{1, 1, 2, 2, ..., k, k\}$ (with two copies of each value from 1 to k) with the additional property that, for each value i appearing in the permutation, the values between the two copies of i are larger than i.
> 
> 
> 

An example of the Stirling permutations of order 4 is as follows:

[![Stirling permutations of order 4](https://i.stack.imgur.com/G8wah.png)](https://i.stack.imgur.com/G8wah.png)

Another interesting image from the Wikipedia page states that a Stirling permutation can be constructed from an Euler tour of a plane tree with its edges labeled by construction order. With an example as such:

[![Euler tour](https://i.stack.imgur.com/7hMk8.png)](https://i.stack.imgur.com/7hMk8.png)

My questions are as follows:

1. How do I define a function that outputs the $k^{th}$ order Stirling permutations in a tabular manner as shown in the first image?
2. How do I display all Stirling permutations in the form of the plane trees and corresponding Euler tours as shown in the second image? Is this even possible to do?