Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    many thanks for the kind words
  2. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    It always did for me.
  3. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    Where is the value of curr set? It's an argument to a method. What is its value when the call is made?
    Is null a valid value? What would it be if the list is empty?
  4. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    Sorry I don't understand where you are referencing curr that it is null. I assume that curr is the value passed to a method. Can you show the code and the debug output that shows when it is null?
  5. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    What is the logic? Your code has no comments so I don't know what your logic is.

    When I added these two comments at the appropriate places in the code, I saw what was wrong and was able to fix it....
  6. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    Time to get out the paper and pencil and work thru how the links should be set and when.
    I notice that there are no comments in the code as to what it needs to do at each point in the logic.
    For...
  7. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    I don't know how you are debugging. I use printlns.
    For good debug output you need to add a toString method to Node class:

    public String toString() {
    return...
  8. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    Could you send the one I'm to test. Not edits needed.
    The one you sent was unformatted. I don't like working with unformatted code.
    Be sure the code is formatted.
  9. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    The one that shows the problem.
  10. Re: Java Newbie - Sorted Linked List not inserting properly - please help!

    Can you post code that compiles and executes that shows the problem?
    Remember to add code tags: BB Code List - Java Forums
Results 1 to 10 of 10