title: Creating custom LinkedList
body: <p>I am working on creating my own LinkedList. But I can't seem to solve this error. Can anyone help me!</p>
  
  <p>The problem is that I want to insert an object after a particular element. I have created <code>Find</code> method to search for that particular item and return its reference, but I can't seem to solve it.</p>
  
  <pre><code>CustomLinkedList c = new CustomLinkedList();
          c.Add(31);
  
          c.Add(45);
  
          c.Add(23);
  
          c.Add(36);
  
          c.PrintList();
  
          Console.WriteLine("\n" + " Process of adding item at a spectifed location");
          c.Addafter(66,23);
  
  
          c.PrintList();
  
  class Node
  {
  
      public object Element;
      public Node Link;
  
      public Node()
      {
          Element = null;
          Link = null;
      }
  
      public Node(object TheElement)
      {
          Element = TheElement;
          Link = null;
      }
  
  class CustomLinkedList
  {
      protected Node header;
      protected Node last;
  
      public CustomLinkedList()
      {
          //header = new Node("header");
      }
  
      private Node Find(object Item)
      {
          Node Current = new Node();
          Current = header;
          while (Current.Element != Item &amp;&amp; Current.Link !=null)
          {
              Current = Current.Link;
          }
          return Current;
      }
  
  
      public void PrintList()
      {            
          Node n = new Node();
          n = header;
          while (n != null)
          {
              Console.WriteLine(n.Element);
              n = n.Link;
          }
      }
  
      public void Add(object a)
      {
          Node n = new Node();
          n.Element = a;
          n.Link = null;
          if (last == null)
          {
              header = n;
              last = n;
          }
          else
          {
              last.Link = n;
              last = n;
          }
      }
  
      public void Addafter(object newitem, object After)
      {
          Node current = new Node();
          Node newNode = new Node(newitem);
          current = Find(After);
  
          newNode.Link = current.Link;
          current.Link = newNode;
      }
  }
  </code></pre>