Linked List Traversal

Hi! I'm writing a code for a function of a sorted linked list in which I have to insert an item at its correct position. However, during the traversal, I'm going one node too far, i.e. if my list is 1, 2, 3, 5, 6 and I have to insert 4, it should be after 3. By going one node ahead, it is inserted after 5. Can anybody please suggest a solution? Thank you.
Are we suppose to read your mind and access your code through black magic? It's mind blowing that you choose not to provide the code in which you are having trouble with.
Topic archived. No new replies allowed.