Do not use on any
shared computer
May 17, 2008 01:57am pdt
12.10.2004 at 07:27AM PST, ID: 21237976
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Sorting ArrayList Objects.
Tags: arraylist, sort
Hi,

     Below is the class which sorts the list of strings and integers. I passed the arguments as 115R 1125R 147C 37R 57R 37C and it shows the result as 1125R 115R 147C 37C 37R 57R. But the problem is I want the output as 37C 37R 57R 115R 147C 1125R. Can anyone help me with this. Its really important.

import java.util.*;

public class SortArrayList
{      
      public static void main(String s[])
      {  
            Collections col;
            List l = sort(s);
            
            System.out.println("\nStrings sorted List ...");
            for(int i = 0; i < s.length; i++)
            {
                  System.out.println((String)l.get(i));
            }
            
            int ints[] = {
                                    11, 2, -22, 401, 6
                                    };
            
            Integer in[] = new Integer[ints.length];            
            for(int i = 0; i < in.length; i++)
            {
                  in[i] = new Integer(ints[i]);
            }
            
            l = sort(in);
            System.out.println("\nIntegers sorted List ...");
            
            for(int i = 0; i < in.length; i++)
            {
                  System.out.println((Integer)l.get(i));
            }
    }
      
    public static List sort(Object o[])
    {
            ArrayList al = new ArrayList();
            for(int i = 0; i < o.length; i++)
            al.add(i, o[i]);
            List list = Collections.synchronizedList(al);
            Collections.sort(list);
            return list;
    }
}



Thanks.

Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: sunny08
Solution Provided By: zzynx
Participating Experts: 2
Solution Grade: A
Views: 1580
Translate:
Loading Advertisement...
12.10.2004 at 07:40AM PST, ID: 12793180

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 07:42AM PST, ID: 12793202

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 07:46AM PST, ID: 12793272

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 07:50AM PST, ID: 12793319

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 07:51AM PST, ID: 12793335

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 08:17AM PST, ID: 12793640

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 08:24AM PST, ID: 12793720

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 08:26AM PST, ID: 12793757

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 08:34AM PST, ID: 12793853

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 08:35AM PST, ID: 12793860

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 08:38AM PST, ID: 12793896

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.10.2004 at 08:48AM PST, ID: 12793997

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.11.2004 at 04:08AM PST, ID: 12799372

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.12.2004 at 06:28PM PST, ID: 12806171

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.12.2004 at 07:07PM PST, ID: 12806281

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.13.2004 at 12:04AM PST, ID: 12807062

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.13.2004 at 06:23AM PST, ID: 12809349

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.13.2004 at 06:56AM PST, ID: 12809619

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.13.2004 at 08:01AM PST, ID: 12810309

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.22.2004 at 09:09AM PST, ID: 12885608

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.23.2004 at 12:01AM PST, ID: 12890689

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.28.2005 at 09:49AM PST, ID: 13645332

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.29.2005 at 03:46AM PST, ID: 13651467

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.29.2005 at 07:43AM PST, ID: 13653305

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.30.2005 at 12:29AM PST, ID: 13659906

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
12.10.2004 at 07:40AM PST, ID: 12793180

Rank: Genius

Try replacing

Collections.sort(list);

by

Collections.sort(list, new Comparator() {

     public int compare(Object o1, Object o2) {
          String s1 = (String)o1;
          String s2 = (String)o2;

          String integer1[] = s1.split("[0-9]");
          String integer2[] = s2.split("[0-9]");
          String chars1[] = s1.split("[^0-9]");
          String chars2[] = s2.split("[^0-9]");

          Integer i1 = new Integer( Integer.parseInt(integer1[0]) );
          Integer i2 = new Integer( Integer.parseInt(integer2[0]) );
   
          if (i1.equals(i2)
             return chars1[1].compareTo(chars2[1]);
          else
             return i1.compareTo(i2);
     }
});
 
12.10.2004 at 07:42AM PST, ID: 12793202

Rank: Genius

>> Its really important.
Maybe you could have considered 500pts ;°)
 
12.10.2004 at 07:46AM PST, ID: 12793272

Rank: Genius

Wait a minute... that's not OK...
 
12.10.2004 at 07:50AM PST, ID: 12793319

Rank: Genius

Correction:

Collections.sort(list, new Comparator() {

     public int compare(Object o1, Object o2) {
          String s1 = (String)o1;
          String s2 = (String)o2;

          String integer1[] = s1.split("[^0-9]");      // <<<<<  changed
          String integer2[] = s2.split("[^0-9]");      // <<<<<  changed
          String chars1[] = s1.split("[0-9]+");         // <<<<<  changed
          String chars2[] = s2.split("[0-9]+");         // <<<<<  changed

          Integer i1 = new Integer( Integer.parseInt(integer1[0]) );
          Integer i2 = new Integer( Integer.parseInt(integer2[0]) );
   
          if (i1.equals(i2)
             return chars1[1].compareTo(chars2[1]);
          else
             return i1.compareTo(i2);
     }
});
 
12.10.2004 at 07:51AM PST, ID: 12793335

Rank: Genius

I assumed that your list contains Strings like "115R", "1125R", "147C", "37R", "57R", "37C",...
 
12.10.2004 at 08:17AM PST, ID: 12793640
zzynx is 100% correct that you should use a comparator, but you might find a simpler impelementation more readable.

I'm also not a big fan of anonymous inner class (they clutter the code something awful IMO).
 
Something like this would work just as well:

Collections.sort(list, new SpecialComarator());

Class SpecialComparator
implements Comparator
{
     public int compare(Object o1, Object o2)
    {
        String s1 = (String)o1;
        String s2 = (String)o2;

         int offset1 = findCharOffset(s1);
         int offset2 = findCharOffset(s2);

         int v1 = Integer.parseInt(s1.substring(0,offset1));
         int v2 = Integer.parseInt(s2.substring(0,offset2));

        int difference = v1 - v2;

        if (difference != 0)
        {
            return difference;
        }

        return s1.substring(offset1).compareTo(s2.substring(offset2));
    }

    private int findCharOffset(String value)
    {
        integer result = 0;
        while (result < value.length() && Character.isDigit(value.charAt(result))
        {
             result++;
        }

        return result;
    }
}
 
12.10.2004 at 08:24AM PST, ID: 12793720

Rank: Genius

>> I'm also not a big fan of anonymous inner class
In this case I find an inner class is on it's place: It's here that you need the sorting; it's here that you find the Comparator class.
But, that's a matter of taste of course ;°)

>>...but you might find a simpler impelementation more readable.
Well, it's a matter of being/making yourself familiar with regular expressions.
In the past I also wasn't a big fan of them.
But once you discover their power...
 
12.10.2004 at 08:26AM PST, ID: 12793757
Hi zzynx,

        Thank you for the quick response. I executed the code which shows the result as 1125R 115R 147C 37C 37R 57R. but I need the result as 37C 37R 57R 115R 147C 1125R. Can you help me with this.


Thanks.
 
12.10.2004 at 08:34AM PST, ID: 12793853

Rank: Genius

Are you sure?
For me it just works:

        List list = new ArrayList();
        list.add("1125R");
        list.add("115R");
        list.add("147C");
        list.add("37C");
        list.add("37R");
        list.add("57R");
        Collections.sort(list, new Comparator() {

             public int compare(Object o1, Object o2) {
                  String s1 = (String)o1;
                  String s2 = (String)o2;

                  String integer1[] = s1.split("[^0-9]");      // <<<<<  changed
                  String integer2[] = s2.split("[^0-9]");      // <<<<<  changed
                  String chars1[] = s1.split("[0-9]+");         // <<<<<  changed
                  String chars2[] = s2.split("[0-9]+");         // <<<<<  changed

                  Integer i1 = new Integer( Integer.parseInt(integer1[0]) );
                  Integer i2 = new Integer( Integer.parseInt(integer2[0]) );

                  if (i1.equals(i2))
                     return chars1[1].compareTo(chars2[1]);
                  else
                     return i1.compareTo(i2);
             }});
        System.out.println("\nStrings sorted List ...");
        for(int i = 0; i < list.size(); i++) {
               System.out.println((String)list.get(i));
        }

Output:
Strings sorted List ...
37C
37R
57R
115R
147C
1125R
 
12.10.2004 at 08:35AM PST, ID: 12793860

Rank: Genius

I'm going offline. Success.
 
12.10.2004 at 08:38AM PST, ID: 12793896
>>>...but you might find a simpler impelementation more readable.
> Well, it's a matter of being/making yourself familiar with regular expressions.
> In the past I also wasn't a big fan of them.
> But once you discover their power...

Sure, regular expressions are powerful things and I know full well HOW to use them. I'm not conviced that they are the most appropriate solution in this case - they're TOO powerful and unnecessarily complicate an essentially simple problem.

An of course, that too is a matter of taste. I'm a card carrying member of "Do The Simplest Thing That Could Possibly Work".

Actually thinking about it more clearly, something like this would also work:

Class SpecialComparator
implements Comparator
{
     public int compare(Object o1, Object o2)
    {
        String s1 = (String)o1;
        String s2 = (String)o2;

         int v1 = Integer.parseInt(s1.substring(0,s1.length() - 1));
         int v2 = Integer.parseInt(s2.substring(0,s2.length() - 1));

        int difference = v1 - v2;

        if (difference != 0)
        {
            return difference;
        }

        return Character.getNumericValue(s1.charAt(length() - 1) -
                 Character.getNumericValue(s2.charAt(length() - 1);
    }
 
12.10.2004 at 08:48AM PST, ID: 12793997
Hi,

     I am not getting the write output. I don't think this is working, but hey thanks for the response. I appreciate that.

Thanks.
 
12.11.2004 at 04:08AM PST, ID: 12799372

Rank: Genius

>> I am not getting the write output
You mean with what I posted? Impossible. It just works for me!
It outputs:
37C
37R
57R
115R
147C
1125R

Can you show us the exact code you have for the moment? There must be something wrong with it...
 
12.12.2004 at 06:28PM PST, ID: 12806171
Hi zzynx,
         
        Here is the exact code which I have. Please help me with this. Here is the arguments which I passed while executing 115R 1125R 147C 37R 57R 37C and I am getting the output as  1125R 115R 147C 37C 37R 57R. Below is the code:


import java.util.*;

public class SortObjects
{      
      public static void main(String s[])
      {  
            Collections col;
            List l = sort(s);
            
            System.out.println("\nStrings sorted List ...");
            for(int i = 0; i < s.length; i++)
            {
                  System.out.println((String)l.get(i));
            }
            
            int ints[] = {
                                    11, 2, -22, 401, 6
                                    };
            
            Integer in[] = new Integer[ints.length];            
            for(int i = 0; i < in.length; i++)
            {
                  in[i] = new Integer(ints[i]);
            }
            
            l = sort(in);
            System.out.println("\nIntegers sorted List ...");
            
            for(int i = 0; i < in.length; i++)
            {
                  System.out.println((Integer)l.get(i));
            }
    }
      
    public static List sort(Object o[])
    {
            ArrayList al = new ArrayList();
            for(int i = 0; i < o.length; i++)
            al.add(i, o[i]);
            List list = Collections.synchronizedList(al);
            
            Collections.sort(list, new Comparator()
            {

            public int compare(Object o1, Object o2)
            {
                                   
                  String s1 = (String)o1;
                String s2 = (String)o2;

                int v1 = Integer.parseInt(s1.substring(0,s1.length() - 1));
                int v2 = Integer.parseInt(s2.substring(0,s2.length() - 1));

                int difference = v1 - v2;

                if (difference != 0)
                {
                    return difference;
                }

                return Character.getNumericValue(s1.charAt(s1.length() - 1)) -
                         Character.getNumericValue(s2.charAt(s1.length() -1));
                  
            }
        });
      
            //Collections.sort(list , new SpecialComparator());
            
            System.out.println("\nStrings sorted List ...");
            
            for(int i = 0; i < list.size(); i++)                        
          System.out.println((String)list.get(i));
            
            return list;
    }
   
}


Thanks in advance.
 
12.12.2004 at 07:07PM PST, ID: 12806281
hi,


    I have tried this code too.


/*
 * Created on Dec 10, 2004
 *
 * @author z688240
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

import java.util.*;

public class SortObjects
{      
      public static void main(String s[])
      {  
            Collections col;
            List l = sort(s);
            
            System.out.println("\nStrings sorted List ...");
            for(int i = 0; i < s.length; i++)
            {
                  System.out.println((String)l.get(i));
            }
            
            int ints[] = {
                                    11, 2, -22, 401, 6
                                    };
            
            Integer in[] = new Integer[ints.length];            
            for(int i = 0; i < in.length; i++)
            {
                  in[i] = new Integer(ints[i]);
            }
            
            l = sort(in);
            System.out.println("\nIntegers sorted List ...");
  &nb