link

 
 public void addItemToListAtNthPosition(int item, int position)
    {
        Node tmp = new Node();
        tmp.data = item;
        tmp.next = null;

        Node current = head;
        Node previous = null;

        int n=0;
        while (current!=null)
        {
            if (n==position)
            {
                if (n==0)
                {
                    tmp.next=head;
                    head = tmp;
                }
                else
                {
                    previous.next=tmp;
                    tmp.next=current;