You are viewing a single comment's thread. Return to all comments →
When the input's head is empty and position > 0, I think you will have a problem at "cur = cur.next" inside the while.
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 →
When the input's head is empty and position > 0, I think you will have a problem at "cur = cur.next" inside the while.