Results 1 to 3 of 3
  1. #1
    bit_bit is offline Member
    Join Date
    Feb 2010
    Location
    Italy
    Posts
    4
    Rep Power
    0

    Default list sorting problem.

    hi there.
    i posted the same problem in the begginer's section but it seems like nobody can help me. can somebody in here help me?
    http://www.java-forums.org/new-java/...ng-method.html this is the link to the original thread.
    thank you in advance.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,409
    Blog Entries
    7
    Rep Power
    25

    Default

    Quote Originally Posted by bit_bit View Post
    hi there.
    i posted the same problem in the begginer's section but it seems like nobody can help me. can somebody in here help me?
    http://www.java-forums.org/new-java/...ng-method.html this is the link to the original thread.
    thank you in advance.
    Your sort method doesn't work: make a copy of the entire list before you split it; you can see the erroneous behaviour it you jot the steps down by hand for a, say, four element list.

    kind regards,

    Jos

  3. #3
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    9

    Default

    If you're doing this as part of your job or some personal project, you should throw away your class and use a LinkedList. To sort it, use Collections.sort. 2 lines of code.

Similar Threads

  1. List Sorting method.
    By bit_bit in forum New To Java
    Replies: 1
    Last Post: 02-24-2010, 12:44 PM
  2. Replies: 5
    Last Post: 02-07-2009, 08:48 AM
  3. Sorting a linked list
    By Hayzam in forum New To Java
    Replies: 4
    Last Post: 01-18-2009, 01:07 AM
  4. Converting array to list and sorting it
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:36 PM
  5. sorting problem
    By mcal in forum New To Java
    Replies: 1
    Last Post: 02-14-2008, 09:13 AM

Posting Permissions

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