title: Map A Recursive Tree to A Flat List with conditions
body: <p>I'm writing a c# app and I have a recursive tree that looks like this:</p>
  
  <pre><code>Item1
  |-Container(min 0, max 1)
  | |-Item2
  | | |-Container(min 0, max 1)
  | |   |-Item5
  | |-Item3
  | | |-Container(min 1, max 1)
  | |   |-Item8
  |-Container(min 1, max 1)
  | |-Item4
  | |-Item7
  |-Container(min 1, max 1)
    |-Item6
  </code></pre>
  
  <p>And I need to convert it to a list as follows:</p>
  
  <pre><code>Item1-Item6-Item4
  Item1-Item6-Item4-Item2
  Item1-Item6-Item4-Item2-Item5
  Item1-Item6-Item4-Item3-Item8
  Item1-Item6-Item7
  Item1-Item6-Item7-Item2
  Item1-Item6-Item7-Item2-Item5
  Item1-Item6-Item7-Item3-Item8
  </code></pre>
  
  <p>following those condition: </p>
  
  <ul>
  <li>if a container has min greater than 0 then its items should always added to parent item like <code>item4</code>, <code>item7</code> and <code>item6</code>, </li>
  <li>if not it should be added to the essential items like <code>item2</code>, <code>item3</code>, and <code>item5</code>,</li>
  <li>items of the same container is not grouped in the same set</li>
  </ul>