Java : Java Stuff!!
Updated: 3/6/2004; 12:54:45 PM.

 

Subscribe to "Java" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Friday, March 07, 2003

I had a problem today that I believe I finally solved....here's the problem...

Given an array as follows 

{"A10", "A2", "12", "Z1", "A100"}

 sort it such that the array is

{"12", "A2", "A10", "A100", "Z1"}

The normal Arrays.sort(array)...would return the following

{"12", "A10", "A100", "A2", "Z1"}

Here's the code and the Junit Test Case

Don't know what JUnit is....click here

Have any idea's of how to do this better??


6:57:16 PM    comment []

© Copyright 2004 Peter Ghali.



Click here to visit the Radio UserLand website.

 


March 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Feb   Apr