title: Duplicate a linked list
body: <p>I wrote a method which creates a copy of linked list.<br>
  Can you guys think of any method better than this?  </p>
  
  <pre><code>public static Node Duplicate(Node n)
          {
              Stack&lt;Node&gt; s = new Stack&lt;Node&gt;();
  
              while (n != null)
              {
                  Node n2 = new Node();
                  n2.Data = n.Data;
                  s.Push(n2);
                  n = n.Next;
              }
  
              Node temp = null;
  
              while (s.Count &gt; 0)
              {
                  Node n3 = s.Pop();
                  n3.Next = temp;
                  temp = n3;
              }
  
              return temp;
  
          }
  </code></pre>