Inserting at a specific point in a linked list
<p>I am new to programming and I cannot figure out how to insert a node at a specific location in a linked list. It has to be inserted at position 3. Help with the logic for the insert would be greatly appreciated. </p>

<pre><code>public void ins (Player p)
{
  PlayerNode current = head;
  PlayerNode previous = head;
  PlayerNode pn = new PlayerNode (new Player (p));
  int count=0;
  if (isEmpty())
  {
    pn.setNext(head);    
    head = pn;
    ++numberOfItems;

  }
  else
  {
    if (count != 3)
    {
      current = current.getNext();
      previous.setNext(pn);
      pn.setNext(current);

      ++count;
    }   
  }
}
</code></pre>
