Results 1 to 7 of 7
  1. #1
    bubbleboy is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default Java Newbie - Sorted Linked List not inserting properly - please help!

    I have no idea what to do after this point (I tried using debugger and I am really new to this.. ) i think the issue is in the else if statements but I have no idea how to correct them

    what am i doing wrong and if you need more code for reference pls let me know i will PM it to you
    Last edited by bubbleboy; 06-16-2011 at 05:38 AM.

  2. #2
    Toll's Avatar
    Toll is offline Senior Member
    Join Date
    May 2011
    Location
    Sweden
    Posts
    392
    Rep Power
    4

    Default

    Well, for starters, it does the exact same thing no matter if the new node is smaller, equal or greater than the one you're comparing to.

  3. #3
    bubbleboy is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default

    Oh..

    but if i remove one of them, then nothing works =/

    sorry im really new to java so forgive me if i describe my experience in a noobish way
    Last edited by bubbleboy; 06-16-2011 at 05:39 AM.

  4. #4
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,784
    Rep Power
    7

    Default

    Quote Originally Posted by bubbleboy View Post
    but if i remove one of them, then nothing works
    If you are referring to the else if branches then that is not what was suggested. The subtle hint was the the 2 else if statements should be doing different things.

  5. #5
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,784
    Rep Power
    7

  6. #6
    bubbleboy is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default

    its messing up at the 3rd iteration and i've spent the past 4 hrs trying to understand how to correct it :(

    this is driving me insane lol and i'm going to slap myself when i find the solution and find that it was either not very hard or time consuming ._.

    sorry for double post it was just done in an attempt to get more answers. i didnt know i was breaking rules by doing that.

  7. #7
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,784
    Rep Power
    7

    Default

    It's sorta an unwritten rule. Suppose I was providing help here while at the same time you are getting the same help in the other thread. Most people don't like wasting their time.

Similar Threads

  1. Replies: 4
    Last Post: 02-21-2011, 09:34 AM
  2. Sorted Doubly linked List
    By student2889 in forum New To Java
    Replies: 1
    Last Post: 10-14-2010, 10:05 AM
  3. How to create a Sorted List in Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:31 PM
  4. Replies: 0
    Last Post: 04-14-2008, 08:39 PM
  5. My doublyLinked list does not get sorted
    By hasani6leap in forum New To Java
    Replies: 0
    Last Post: 01-06-2008, 03:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •