Results 1 to 2 of 2
  1. #1
    NoobieCode is offline Senior Member
    Join Date
    Mar 2013
    Posts
    123
    Rep Power
    0

    Default how to sort a generic single list of T objects from smallest to greatest

    How do I sort a generic single-linked list of T objects from smalles to greatest?

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,091
    Rep Power
    4

    Default Re: how to sort a generic single list of T objects from smallest to greatest

    Define what is smaller and greater. Comparable would be your friend there. After that, try using Collections.sort().

Similar Threads

  1. Replies: 7
    Last Post: 10-14-2012, 07:05 AM
  2. Organizing a list of integers from greatest to least
    By natdizzle in forum New To Java
    Replies: 3
    Last Post: 08-18-2012, 12:55 AM
  3. Collections sorting a list made of generic class objects
    By andreiutz10 in forum New To Java
    Replies: 5
    Last Post: 02-07-2012, 06:56 PM
  4. How to sort a list using Bubble sort algorithm
    By Java Tip in forum Algorithms
    Replies: 3
    Last Post: 04-29-2008, 09:04 PM

Tags for this Thread

Posting Permissions

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