title: Return the list of items which are part of the longest path from Tree's root to a Leaf in a General Tree
body: <p>Given this Class that represents a tree , i got a little confused on how would i return a list that will consist of nodes that are part of the tree's height .</p>
  <pre><code>public class TreeNode&lt;T&gt;
      {
  
          private T m_Data;
          public T Data
          {
              get
              {
                  return m_Data;
              }
              set
              {
                  m_Data = value;
              }
          }
          private readonly List&lt;TreeNode&lt;T&gt;&gt; m_Children;
          public List&lt;TreeNode&lt;T&gt;&gt; Children
          {
              get
              {
                  return m_Children;
              }
          }
  
          public TreeNode(T i_Data)
          {
              this.m_Data = i_Data;
              m_Children = new List&lt;TreeNode&lt;T&gt;&gt;();
          }
  
          public void AddChild(T data)
          {
              m_Children.Add(new TreeNode&lt;T&gt;(data));
             // return m_Children[m_Children.Count-1];
          }
  
          public List&lt;T&gt; LongestPathNodes(TreeNode&lt;T&gt; i_node)//this function
          {
              if(i_node.m_Children.Count == 0)
              {
                  List&lt;T&gt; choosenMove = new List&lt;T&gt;(1);
                  choosenMove.Add(i_node.Data);
                  return choosenMove;
  
              }
              else
              {
                  foreach(TreeNode&lt;T&gt; treeNode in i_node.Children)
                  {
                      
                  }
              }
          }
  </code></pre>
  <p>The function which i'm talking about is the &quot;LongestPathNodes&quot; Function ,I think it has to be recursive ,  i wrote part of it but i'm confused on how should i proceed , given the fact that the tree does not have to be a binary one .</p>