title: C# recursively go through items in a List of T where T has a List of T
body: <p>So let's say i have a this class T which contains a List variable. How can I go through all items inside of List and then all items inside of each items of the List and so on until every single items have been treated? I know how to do this using a recursive method but i'm wondering if there is a way without using a recursive method that calls itself. Sorry if the question is confusing, a better example using folders could be as </p>
  
  <p>Folder1 > contains Folder2, Folder3, Folder4</p>
  
  <p>Folder2 > contains Folder5, Folder6</p>
  
  <pre><code>Folder5 &gt; contains Folder7
  </code></pre>
  
  <p>Folder3 > contains Folder8, Folder9</p>
  
  <pre><code>Folder9 &gt; contains Folder10
  
    Folder10 &gt; contains Folder11
  </code></pre>
  
  <p>I would like to iterate through all of these folders in order (f1, f2, f5, f7, f6, f3, f8, f9, f10, f11, f4)</p>
  
  <p>Does this make more sense? Thanks.</p>