Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    Your insertion logic is incorrect: You change the current pointer, but you never change the next pointer of any node to point to a new element in the linked list. As written, your list can never have more than one node in it. Commented Feb 2, 2011 at 16:14
  • Since you say you're setting ll to NULL in a constructor, is it a member of a class? Is this addToLL function a method of a class? Commented Feb 2, 2011 at 16:14
  • Sorry, for brevity I cut it down. Both ll and the method are a member of the same class. Commented Feb 2, 2011 at 16:24