You are viewing a single comment's thread. Return to all comments →
Java solution, help me to get out from an error.
SinglyLinkedListNode temp=new SinglyLinkedListNode(data); if(llist==null){ return temp; } if(position==0){ temp.next=llist; return temp; } SinglyLinkedListNode nh=llist; while(position-1>0){ nh=nh.next; position--; } temp.next=nh.next; nh.next=temp; return llist;
Seems like cookies are disabled on this browser, please enable them to open this website
Insert a node at a specific position in a linked list
You are viewing a single comment's thread. Return to all comments →
Java solution, help me to get out from an error.